How to save outputs like contours and point clouds?

Feel free to ask any question here
qlddrones
Posts: 5
Joined: Fri Jul 20, 2018 4:48 am

How to save outputs like contours and point clouds?

Post by qlddrones »

I hope you will excuse a newbie dumb question, but I am struggling to get meaningful exports from CloudCompare. I was able to import 4 Lidar point clouds, merge them together, crop to an area of interest, classify to ground and generate contours, very easy and straightforward. But what I need to do from there is (1) export the cropped point cloud as a new LAS file, (2) export a DEM (tif) and (3) export the contours as a SHP file or KML with elevation labels visible in Google Earth.

Is anyone able to help me understand how to achieve those three things? I am using v2.9.1 64-bit on Windows.
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to save outputs like contours and point clouds?

Post by daniel »

- Exporting the cloud as a LAS file should be easy (select the cloud, 'File > Save', select the 'LAS' filter)
- To generate a DEM and export it to a geotiff file, there's only one solution: use the Rasterize tool and then click on the 'Raster' button in the 'export' section
- Last, to export the contours, generate them (in the Rasterize tool), then export them to the main data-base, and last select the group of contours (all contours should be under a unique group) and once again go to 'File > Save', and select the 'SHP' filter
Daniel, CloudCompare admin
qlddrones
Posts: 5
Joined: Fri Jul 20, 2018 4:48 am

Re: How to save outputs like contours and point clouds?

Post by qlddrones »

I did as you suggest for the contours Daniel, but the SHP file set is missing the PRJ file so cannot be used. Do you have any idea what I'm missing that would cause this? The original point cloud is georeferenced but I think this gets removed when you open it in CC? How do you restore the georeferencing so it can produce a PRJ file?
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to save outputs like contours and point clouds?

Post by daniel »

Hum, CC doesn't create the PRJ file indeed (I don't even know what that is :D). But if a cloud has large coordinates, they should be loaded (well, at least stored as a "Global Shift" information) and then restored on export.
Daniel, CloudCompare admin
qlddrones
Posts: 5
Joined: Fri Jul 20, 2018 4:48 am

Re: How to save outputs like contours and point clouds?

Post by qlddrones »

PRJ contains the projection data to allow the exported file to be overlaid on other projected data, e.g. in Google Earth or an ESRI platform. Without it, shape files are pretty useless.
qlddrones
Posts: 5
Joined: Fri Jul 20, 2018 4:48 am

Re: How to save outputs like contours and point clouds?

Post by qlddrones »

This is what the data should look like inside a PRJ file:

GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
matknaak
Posts: 38
Joined: Wed May 04, 2016 12:43 pm

Re: How to save outputs like contours and point clouds?

Post by matknaak »

CC might not create a prj file, but it stores the correct coordinates, and you should be able to generate the prj file very easily in the GIS software you use - e.g. in ArcGIS you can use the Cataloge and simply set the projection etc.
Felix
Posts: 4
Joined: Fri Nov 01, 2019 1:55 am

Re: How to save outputs like contours and point clouds?

Post by Felix »

Hi, I also met a similar problem to yours. I had thought about creating a PRJ file for the CC generated .shp file. But later, I found it was not necessary.

If your goal is to maintain the relative position of the .shp file to point clouds, all you need to do is to make sure the global shift is set to correct values. Actually, CC would save the global coordinates of every point in a polygon when you save it as a .shp file. But when you reload it on another day, it may not automatically remind you to apply a global shift as what you see when you load a point cloud. That's the problem (or probably a small bug)! You need to manually apply a transformation to the .shp file using exactly the global shift when you load the point cloud. This can be done by going to Edit -> Apply Transformation -> Set the translation parameters. Then you will see the same relative position as you want you have seen before. You can always double-check the global shift by selecting the polygon and then going to the properties panel -> polyline -> global shift.

I also tried to generate a shapefile using QGIS v3.16.3, which did give me a .prj file along with the .shp file. One strange thing was that when I opened the QGIS-generated .shp file with CC, it reminded me to set the global shift, which would not happen if I open the CC-generated .shp file with CC. Anyway, the key point is the global shift!

I was using CloudCompare v2.11.3(Anoia) Stereo [64-bit].

qlddrones wrote: Sat Jul 21, 2018 10:19 pm This is what the data should look like inside a PRJ file:

GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to save outputs like contours and point clouds?

Post by daniel »

Hum, weird, normally, CC should handle / suggest a Global Shift as with any other file type.

Can you maybe share your SHP file with me? (admin [at] cloudcompare.org)
Daniel, CloudCompare admin
Felix
Posts: 4
Joined: Fri Nov 01, 2019 1:55 am

Re: How to save outputs like contours and point clouds?

Post by Felix »

daniel wrote: Sat Feb 20, 2021 4:48 pm Hum, weird, normally, CC should handle / suggest a Global Shift as with any other file type.

Can you maybe share your SHP file with me? (admin [at] cloudcompare.org)
Sorry about the late reply. I have sent it to your email. Thanks!
Post Reply