Skip to main content

Library for common LAS files manipulation with PDAL

Project description

ign-pdal-tools

This repo contains various python tools based on PDAL that are used to work on LiDAR data in the LidarHD project at IGN (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.

Content

This library contains pdal-based tools to:

  • colorize a point cloud using images from Geoplateforme / cartes.gouv.fr (a portal from French government providing access to aerial imagery)
  • stitch together LAS files using their location
  • standardize LAS files
  • unlock LAS files generated by TerraSolid

Installation / Usage

This library can be used in different ways:

  • directly from sources: make install creates a mamba environment with the required dependencies
  • installed with pip from pypi: pip install ign-pdal-tools
  • used in a docker container: see documentation Dockerfile

More details on the contained tools

Colorization

  • color.py: Colorize a point cloud from Geoplateforme data

Las infos

Misc 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:

from pdaltools import las_infos

filename = ...
las_infos.las_info_metadata(filename)

Point cloud infos

Misc tools to get information on a point cloud (numpy array). Eg. get expected origin of a point cloud based on a square tiling:

from pdaltools import pcd_infos

points = ...
pcd_infos.get_pointcloud_origin_from_tile_width(points, tile_width=1000)

Stitching

  • las_clip.py: crop a LAS file using 2d bounding box
  • las_merge.py: merge a LAS file with its neighbors according to their filenames
  • las_add_buffer.py: add points to a LAS file from a buffer (border) from its neighbors (using filenames to locate neighbors)
  • replace_area_in_pointcloud.py: replace the points from a LAS file by the points of another LAS file inside areas defined in a vector file (geojson, shapefile)

WARNING: In las_merge.py and las_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, xcoord and ycoord are given in kilometers and the shape of the tile is 1 km * 1 km

Standardization

Unlock

unlock_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.

Add points in pointcloud

add_points_in_pointcloud.py: add points from some vector files (ex: shp, geojson, ...) inside Las/Laz:

  • 2 kinds of geometries are handled:
    • if the geometries in the vector file are points, they are added directly to the las file
    • if the geometries are lines, points are added along this line using a spacing parameter
  • In case the points are 2D only, Z can be provided as a feature property (parametrized via altitude_column)
  • The Classification attribute for these points is parametrized via virtual_points_classes
  • All the other attributes are set to 0.

Dev / Build

Contribute

Every time the code is changed, think of updating the version file: pdaltools/_version.py

Please log your changes in CHANGELOG.md

Before committing your changes, run the precommit hooks. They can be installed to run automatically with make install-precommit

Tests

Create the conda environment: make install

Run unit tests: make testing

Pip package

To generate a pip package and deploy it on pypi, use the Makefile at the root of the repo:

  • make build: build the library
  • make install: install the library in an editable way (pip -e)
  • make deploy : deploy it on pypi

Docker image

To build a docker image with the library installed: make docker-build

To test the docker image: make docker-test

To build a docker image with a custom version of PDAL: make docker-build-custom-pdal ; the custom version is defined in the Makefile (see Makefile for details)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ign_pdal_tools-1.15.7.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ign_pdal_tools-1.15.7-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file ign_pdal_tools-1.15.7.tar.gz.

File metadata

  • Download URL: ign_pdal_tools-1.15.7.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ign_pdal_tools-1.15.7.tar.gz
Algorithm Hash digest
SHA256 1402011449095a6a4e9b6259102ff86bdf6215feeb5202c04706a75801e95e81
MD5 4c589f28604a1085f47ae3daa4ac8997
BLAKE2b-256 ee84df1ef308d8eb2f3aa99b6f7e02a4339103b8e631373f115d395cdc48f69d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ign_pdal_tools-1.15.7.tar.gz:

Publisher: cicd_deploy.yml on IGNF/ign-pdal-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ign_pdal_tools-1.15.7-py3-none-any.whl.

File metadata

File hashes

Hashes for ign_pdal_tools-1.15.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7c1e1b0dca84c1497bdc413cb0a59ddad4d264da59b44d13919ec94f0ec58e9f
MD5 a58b81a81d5264223fe8f76ea66ba3d6
BLAKE2b-256 c61d7404e4d6e8af8eda7badabde7d1d02731525a7d4c0e53b376f7ba90cf84d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ign_pdal_tools-1.15.7-py3-none-any.whl:

Publisher: cicd_deploy.yml on IGNF/ign-pdal-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page