tudelft3d / City3D

Large-scale LoD2 Building Reconstruction from Airborne LiDAR Point Clouds
https://github.com/tudelft3d/City3D
GNU General Public License v3.0
223 stars 36 forks source link

Coordinates/Alignment issue #32

Closed IsisKaiser closed 5 months ago

IsisKaiser commented 5 months ago

Hey, thank you for sharing this programme. I have been trying to use a geojson for the footprints of my data, but I can’t seem to get the data aligned with my point cloud data in the GUI even though it is aligned in CloudCompare (LAS/PLY/SHP) and QGIS (LAS/Geojson) with the correct coordinate system. It’s a dataset of a French village, when I try out some Dutch AHN data with footprints I do not get the alignment issue,, Any ideas what causes this? Example_C3D Data_Sample.zip

LiangliangNan commented 5 months ago

Thanks for reporting this issue!

LAS format usually represents very large areas of urban scenes, and the coordinates typically have very large values. For numerical stability (and also for rendering the points properly), the point clouds in LAS format are translated with respect to the first point found in the cloud (during the loading in City3D). Since the point cloud is translated, the footprint should also be translated accordingly. The misalignment you have observed is due to that you firstly loaded the footprint (and then the point cloud), but the translation of the point cloud was not known when loading the footprint. To properly calculate the translation, one should load the point cloud first, then the footprint. This was not handled idealy in the code.

To make it easier for users, I have made changes to the UI in away such that loading the footprint is only possible when the point cloud has already been loaded. You can grab the latest code, build and run City3D, and it should work now. Please let me know if this isn't the case.

IsisKaiser commented 5 months ago

Thank you for making the change! Now the footprint also lays at the minimum z value of the cloud when I load it in second. This really helps.

Just a follow up question, I am wondering if the I could also use the z value(s) of the geojson instead and translate it accordingly, e.g. for hilly landscapes. I'm trying to change the geojson parser accordingly but I can't seem to get the translation right. Any ideas on this, or is there a specific reason the z value of the point cloud is used?

map_serializer_json_z_issue.txt

LiangliangNan commented 5 months ago

You can export you LAS/LAZ point cloud to another format, e.g., PLY, and try again. With PLY format, no transformation will be applied to the point cloud (and also footprint).

Anyway, you have access to the source code and feel free to make any changes that fit your need :-)