Generating a DTM

This exercise uses PDAL to generate an elevation model surface using the output from the Identifying ground exercise, PDAL’s writers.p2g operation, and GDAL to generate an elevation and hillshade surface from point cloud data.

Exercise

Note

The primary input for Digital Terrain Model generation is a point cloud with ground classifications. We created this file, called ground-filtered.laz, in the Identifying ground exercise. Please produce that file by following that exercise before starting this one.

Command

Invoke the following command, substituting accordingly, in your Docker Quickstart Terminal:

PDAL capability to generate rasterized output is provided by the writers.p2g stage. There is no application to drive this stage, and we must use a pipeline.

Pipeline breakdown

{
    "pipeline": [
        "/data/exercises/analysis/ground/ground-filtered.laz",
        {
            "filename":"/data/exercises/analysis/dtm/dtm",
            "output_format":"tif",
            "output_type":"all",
            "grid_dist_x":"2.0",
            "grid_dist_y":"2.0",
            "type": "writers.p2g"
        }
    ]
}

Note

this pipeline is available in your workshop materials in the ./exercises/analysis/dtm/dtm.json file.

1. Reader

ground-filtered.laz is the LASzip file we will clip. You should have created this output as part of the Identifying ground exercise.

2. writers.p2g

The Points2grid writer that bins the point cloud data into an elevation surface.

Execution

1
2
3
docker run -v /c/Users/Howard/PDAL:/data -t pdal/pdal \
       pdal pipeline \
       /data/exercises/analysis/dtm/p2g.json
../../../../_images/dtm-run-command.png

Visualization

Something happened, and some files were written, but we cannot really see what was produced. Let us use QGIS to visualize the output.

  1. Open QGIS and Add Raster Layer:

    ../../../../_images/dtm-add-raster-layer.png
  2. Add the dtm.idw.tif file from your ./PDAL/exercises/analysis/dtm directory.

    ../../../../_images/dtm-add-raster-mean.png ../../../../_images/dtm-qgis-added.png
  3. Classify the DTM by right-clicking on the dtm.idw.tif and choosing Properties. Pick the pseudocolor rendering type, and then choose a color ramp and click Classify.

    ../../../../_images/dtm-qgis-classify.png ../../../../_images/dtm-qgis-colorize-dtm.png
  4. QGIS provides access to GDAL processing tools, and we are going to use that to create a hillshade of our surface. Choose Raster–>Analysis–>Dem:

    ../../../../_images/dtm-qgis-select-hillshade.png
  5. Click the window for the Output file and select a location to save the hillshade.tif file.

    ../../../../_images/dtm-qgis-gdaldem.png
  6. Click OK and the hillshade of your DTM is now available

    ../../../../_images/dtm-qgis-hillshade-done.png

Notes

  1. gdaldem, which powers the QGIS DEM tools, is a very powerful command line utility you can use for processing data.
  2. Points2grid can be used for large data, but it does not interplate typical TIN surface model before interpolating.