Is there a way to merge point clouds attributes in python?

553 Views Asked by At

I have two point clouds (.las file). The coordinates of points (x, y,z) are the same in both the data, but one dataset has intensity attribute, while the other one has classification attribute only. I would like to merge these information, and obtain a point cloud with x,y,z, intensity and classification attributes. I tried converting las file in arrays, but then it take too much time to search for the same point in thee two arrays and append the attributes.

How can i solve my problem?

1

There are 1 best solutions below

2
D.Manasreh On

If it is the same exact point-cloud, then shouldn't the order be the same? If the order is the same then you can just do something like:

new_pc = np.column_stack([point_cloud1, point_cloud2[:, classification_index])

If they are not in the exact same order initially, then just sort both of them out by the x,y,z first. If it is the same point-cloud they will be sorted exactly the same.