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)

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 Las

add_points_in_las.py: add points from some vector files (ex: shp, geojson, ...) inside Las. New points will have X,Y and Z coordinates. Other attributes values given by the initial las file are null (ex: classification at 0). These others attributes could be forced by using the '--dimensions/-d' option in the command line (ex : 'add_points_in_las.py -i myLas.las -g myPoints.json -d classification=64' - points will have their classification set to 64). The dimension should be present in the initial las ; this is not allowed to add new dimension.

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

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.7.6.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

ign_pdal_tools-1.7.6-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ign_pdal_tools-1.7.6.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.11

File hashes

Hashes for ign_pdal_tools-1.7.6.tar.gz
Algorithm Hash digest
SHA256 ff27058ba0d28b70619db658ff9eea7cd6f92b240f1c1061afb9e01060149b1e
MD5 977fe637a3f31594cd0f04180b486829
BLAKE2b-256 dea3a08188202d01d143606af772df1cd525d356dea66dfe6c2936445a97ce34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ign_pdal_tools-1.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0857afd2d8397ca0515cb0240c815cfa3dbe0f74ebadf4efa0b804be26300a93
MD5 3aba33649b4f80f6246f887c1e5cd901
BLAKE2b-256 308485a28a2cba1861da7d63c89b72f61e48ec5a7a3942039055c4abfa4a5050

See more details on using hashes here.

Supported by

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