Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Last active February 13, 2022 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasG77/2d8a7463a0a0bbab1bf31c2418663600 to your computer and use it in GitHub Desktop.
Save ThomasG77/2d8a7463a0a0bbab1bf31c2418663600 to your computer and use it in GitHub Desktop.
Process to convert laz file to DTM

Process laz LIDAR

Based on https://pdal.io/workshop/exercises/analysis/dtm/dtm.html and syntax clue from https://hannes.enjoys.it/blog/2022/01/converting-geotiff-to-las-laz/ for the command line without JSON pipeline

Prerequisites

You need to install both

Download sample

wget 'https://wxs.ign.fr/c90xknypoz1flvgojchbphgt/telechargement/prepackage/LIDARHD_PACK_NP_2021$LIDARHD_1-0_LAZ_NP-0808_6307-2021/file/LIDARHD_1-0_LAZ_NP-0808_6307-2021.7z'
unp LIDARHD_1-0_LAZ_NP-0808_6307-2021.7z # or 7z e LIDARHD_1-0_LAZ_NP-0808_6307-2021.7z

Process using pipeline and JSON to DEM TIFF

echo '{
   "pipeline":[
      "./LIDARHD_1-0_LAZ_NP-0808_6307-2021/Semis_2021_0808_6306_LA93_IGN69.laz",
      {
         "filename":"./LIDARHD_1-0_LAZ_NP-0808_6307-2021/Semis_2021_0808_6306_LA93_IGN69.tif",
         "gdaldriver":"GTiff",
         "output_type":"all",
         "resolution":"0.5",
         "type":"writers.gdal"
      }
   ]
}' >| dtm.json

pdal pipeline ./dtm.json

No json file, only command line

pdal translate ./LIDARHD_1-0_LAZ_NP-0808_6307-2021/Semis_2021_0808_6306_LA93_IGN69.laz out.tif \
               --reader las \
               --writer gdal \
               --writers.gdal.resolution="0.5" \
               --writers.gdal.gdaldriver="GTiff" \
               --writers.gdal.output_type="all"

UNSUCCESSFULL

Tried with ogr output (not working, segmentation issue at the moment)

echo '[
    "./LIDARHD_1-0_LAZ_NP-0808_6307-2021/Semis_2021_0808_6306_LA93_IGN69.laz",
    {
        "type": "writers.ogr",
        "filename": "./LIDARHD_1-0_LAZ_NP-0808_6307-2021/Semis_2021_0808_6306_LA93_IGN69.shp",
        "measure_dim": "Z"
    }
]' >| ogr_output.json

pdal pipeline ./ogr_output.json
pdal translate ./LIDARHD_1-0_LAZ_NP-0808_6307-2021/Semis_2021_0808_6306_LA93_IGN69.laz out.shp --reader las --writer ogr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment