Package: ign-pdal-tools
ign-pdal-toolsThis repo contains various python tools based onPDALthat are used to work on
LiDAR data in theLidarHDproject atIGN(Institut National de l'Information Géographique et Forestière / French National Institute of
Geographic and Forest Information) to work on LiDAR data.We've decided to make them available because think that they may be useful to others, but this repo
is NOT meant to be substantially modified from community input, and may be amended/completed depending
on the fonctionalities that our team needs.ContentThis library contains pdal-based tools to:colorizea point cloud using images fromGeoplateforme / cartes.gouv.fr(a portal
from French government providing access to aerial imagery)stitchtogether LAS files using their locationstandardizeLAS filesunlockLAS files generated by TerraSolidInstallation / UsageThis library can be used in different ways:directly from sources:make installcreates a mamba environment with the required dependenciesinstalled withpipfrom pypi:pip install ign-pdal-toolsused in a docker container: see documentationDockerfileMore details on the contained toolsColorizationcolor.py: Colorize a point cloud from Geoplateforme dataLas infosMisc tools to get information on a las file, eg. retrieve metadata, find epsg value, find bounds, get parameters to pass to a writer. They are intended to be used from the pdaltools module, for example:frompdaltoolsimportlas_infosfilename=...las_infos.las_info_metadata(filename)Stitchinglas_clip.py: crop a LAS file using 2d bounding boxlas_merge.py: merge a LAS file with its neighbors according to their filenameslas_add_buffer.py: add points to a LAS file from a buffer (border) from its neighbors (using filenames to locate neighbors)WARNING: Inlas_merge.pyandlas_add_buffer.py, filenames are used to get the LAS files extents
and to find neighbors.
The naming convention is{prefix1}_{prefix2}_{xcoord}_{ycoord}_{postfix})}(eg.Semis_2021_0770_6278_LA93_IGN69.laz).
By default,xcoordandycoordare given in kilometers and the shape of the tile is 1 km * 1 kmStandardizationstandardize_format.py: re-write a LAS file in a standard format (see code for details)count_occurences: count occurences for each value of a given attribute in a set of LAS files (initially used for classification)count_occurences_for_attribute.py: count occurences in one or several files and save the result in a json file.merge_occurences_counts.py: merge counts from several results ofcount_occurences_for_attribute(json files) into a single json file (used for parallelization)replace_attribute_in_las.py: using a json file containing a correspondance map, replace the occurences of each value in a LAS file by its corresponding value from the map.Unlockunlock_file.py: overwrite a LAS file in case PDAL raises this error:readers.las: Global encoding WKT flag not set for point format 6 - 10.which is due to TerraSolid
malformed LAS output for LAS1.4 files with point format 6 to 10.Dev / BuildContributeEvery time the code is changed, think of updating the version file:pdaltools/_version.pyPlease log your changes inCHANGELOG.mdBefore committing your changes, run the precommit hooks. They can be installed to run automatically withmake install-precommitTestsCreate the conda environment:make installRun unit tests:make testingPip packageTo generate a pip package and deploy it on pypi, use theMakefileat the root of the repo:make build: build the librarymake install: install the library in an editable way (pip -e)make deploy: deploy it on pypiDocker imageTo build a docker image with the library installed:make docker-buildTo test the docker image:make docker-test