CloudCompare is a powerful, open source 3D point cloud and mesh processing software available on all major platforms (Windows, MacOS, Linux). It is my current favorite tool for visualizing 3D point clouds.
CloudCompare is a powerful, open source 3D point cloud and mesh processing software available on all major platforms (Windows, MacOS, Linux). It is my current favorite tool for visualizing 3D point clouds.
Global elevation data is available through NASA’s Shuttle Radar Topography Mission (SRTM) program. For those interested, this blog post compares the resolution of elevation slope maps derived from the SRTM project vs. LiDAR data, and provides a brief background behind the two methods. LiDAR, in short, provides for much higher resolution Digital Elevation Models (DEMs). Here I provide an extensive example of generating contour lines from LIDAR point clouds with classified ground points.
filter_ground.pipeline.json
:
{ "pipeline":[ { "type":"readers.las", "compression": "laszip", "filename":"q47123g8207.laz" }, { "type":"filters.range", "limits": "Classification[2:2]" }, { "type":"writers.text", "order":"X,Y,Z", "keep_unspecified": "false", "quote_header": "false", "delimiter": ",", "filename":"q47123g8207_Ground.txt" } ] }
pdal pipeline filter_ground.pipeline.json
. If you have multiple tiles as I do in this example, you’ll need to run this filter for each file. You can simplify modify the input and output file arguments and save over the same file.Z
.cells
.Recent versions of SAGA GIS no longer support importing files in the .las format. However, a .las file can be converted using PDAL’s writers.text module into a text file format, which in turn can be imported in SAGA. For this example, we will begin with a .las file projected in a state plane CRS that is the output of my post Reprojecting LIDAR .las files to Latitude/Longitude to State Plane Example.
las2xyz.json
in the same directory as your .las
file and paste the following into it:
{ "pipeline": [ { "type": "readers.las", "filename": "20131013_usgs_olympic_wa_10TDT310990.las" }, { "type": "writers.text", "order": "X,Y,Z", "keep_unspecified": "false", "quote_header": "false", "delimiter": ",", "filename": "20131013_usgs_olympic_wa_10TDT310990.txt" } ] }
.txt
file in the working directory.
pdal pipeline las2xyz.json ls -hs -1 total 1.1G 227M 20131013_usgs_olympic_wa_10TDT310990.las 148M 20131013_usgs_olympic_wa_10TDT310990.laz 745M 20131013_usgs_olympic_wa_10TDT310990.txt 4.0K las2xyz.json 4.0K lat_lng_WA_S_FIPS_ft_reprojection.pipeline.json
less 20131013_usgs_olympic_wa_10TDT310990.txt X,Y,Z 803169.892,932562.842,2093.730 803170.060,932566.158,2093.070 803178.839,932573.593,2054.360 803170.851,932564.554,2093.700 803225.508,932562.372,2043.070 803232.723,932560.928,2040.090 803232.361,932562.222,2041.790 803232.443,932564.117,2041.470 803234.863,932568.358,2030.210 803235.004,932568.206,2034.440 803236.294,932567.895,2028.310
.txt
point cloud file that was created by PDAL, with the appropriate options as shown in the screenshot. Click Okay. Since the example text file used is nearly 1.0 GB in size, importing may take some time.Z
as the colored attribute.wget https://coast.noaa.gov/htdata/lidar1_z/geoid12b/data/5008/20131013_usgs_olympic_wa_10TDT310990.laz
lasinfo https://coast.noaa.gov/htdata/lidar1_z/geoid12b/data/5008/20131013_usgs_olympic_wa_10TDT310990.laz
confirms that the x and y coordinates are in lat/lng:
lasinfo (170203) report for 20131013_usgs_olympic_wa_10TDT310990.laz reporting all LAS header entries: file signature: 'LASF' file source ID: 0 global_encoding: 1 project ID GUID data 1-4: 00000000-0000-0000-6C4F-6D7900636970 version major.minor: 1.2 system identifier: 'LAStools (c) by rapidlasso GmbH' generating software: 'lasduplicate (160119) commercia' file creation day/year: 231/2014 header size: 227 offset to point data: 331 number var. length records: 1 point data format: 1 point data record length: 28 number of point records: 25204541 number of points by return: 16034492 6849061 2147980 173008 0 scale factor x y z: 0.0000001 0.0000001 0.001 offset x y z: 0 0 0 min x y z: -123.9223149 47.8406412 248.190 max x y z: -123.9087939 47.8497435 827.800
Thus, re-projecting the .las file is necessary before any further processing can be done. Common CRS systems include UTM based projections, as well as state plane. For this example, I’ve chosen to reproject from lat/lng to NAD 1983 StatePlane Washington South FIPS 4602 Feet as it is what is used by data available through the Puget Sound Lidar Consortium.
Re-projection can be done with PDAL’s filters.reprojection. Create a new JSON pipeline file named lat_lng_WA_S_FIPS_ft_reprojection.pipeline.json
with the following contents:
{ "pipeline": [ { "type": "readers.las", "compression": "laszip", "filename": "20131013_usgs_olympic_wa_10TDT310990.laz" }, { "type": "filters.reprojection", "in_srs": "EPSG:4326", "out_srs": "EPSG:102749" }, { "type": "writers.las", "compression": "laszip", "scale_x": "0.01", "scale_y": "0.01", "scale_z": "0.01", "offset_x": "auto", "offset_y": "auto", "offset_z": "auto", "filename": "20131013_usgs_olympic_wa_10TDT310990.las" } ] }
Now save the file and run the pipeline. This will probably take a while as it involves de-compressing the input .laz file, iterating through and reprojecting every point in the point cloud, and writing the output file to disk. Now, examining the outputted, reprojected .las file with lasinfo 20131013_usgs_olympic_wa_10TDT310990.las
will indicate the min/max in the new projection, as well as the z (elevation) values converted into feet:
lasinfo 20131013_usgs_olympic_wa_10TDT310990.las lasinfo (170203) report for 20131013_usgs_olympic_wa_10TDT310990.las reporting all LAS header entries: file signature: 'LASF' file source ID: 0 global_encoding: 0 project ID GUID data 1-4: 00000000-0000-0000-0000-000000000000 version major.minor: 1.2 system identifier: 'PDAL' generating software: 'PDAL 1.5.0 (Releas)' file creation day/year: 211/2017 header size: 227 offset to point data: 690 number var. length records: 3 point data format: 3 point data record length: 34 number of point records: 25204541 number of points by return: 16034492 6849061 2147980 173008 0 scale factor x y z: 0.01 0.01 0.01 offset x y z: 800114.623206489603035 932554.57963061647024 814.270025000000487 min x y z: 800114.62 932554.58 814.27 max x y z: 803498.24 935938.24 2715.87