25 rdb-example-04-update-points.py 27 This example shows how to open an existing database and modify some points. 28 This example is based on the database of rdb-example-1-create-database. 34 with riegl.rdb.rdb_open(
"pointcloud.rdbx")
as rdb:
37 with riegl.rdb.Transaction(
40 "Point Classifier v1.0" 45 buffer_point_number = riegl.rdb.AttributeBuffer(
46 rdb.point_attributes[
"riegl.id"], buffer_size
48 buffer_point_class = riegl.rdb.AttributeBuffer(
49 rdb.point_attributes[
"riegl.class"], buffer_size
54 with rdb.select(
"riegl.reflectance < -20.0")
as select:
55 select.bind(buffer_point_number)
58 with rdb.update()
as update:
59 update.bind(buffer_point_number)
60 update.bind(buffer_point_class)
64 while point_count > 0:
65 point_count = select.next(buffer_size)
68 for i
in range(point_count):
69 buffer_point_class[i] = 7
72 update.next(point_count)