ign-pdal-tools


Nameign-pdal-tools JSON
Version 1.12.2 PyPI version JSON
download
home_pageNone
SummaryLibrary for common LAS files manipulation with PDAL
upload_time2025-07-16 11:41:32
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ign-pdal-tools

This repo contains various python tools based on [PDAL](https://pdal.io/) that are used to work on
LiDAR data in the [LidarHD](https://www.ign.fr/institut/lidar-hd-vers-une-nouvelle-cartographie-3d-du-territoire)
project at [IGN](https://www.ign.fr) (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](https://www.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](Dockerfile)

# More details on the contained tools

## Colorization

* [color.py](pdaltools/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:

```python
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:

```python
from pdaltools import pcd_infos

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


## Stitching

* [las_clip.py](pdaltools/las_clip.py): crop a LAS file using 2d bounding box
* [las_merge.py](pdaltools/las_merge.py): merge a LAS file with its neighbors according to their filenames
* [las_add_buffer.py](pdaltools/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

* [standardize_format.py](pdaltools/standardize_format.py): re-write a LAS file in a standard format (see code for details)
* [count_occurences](pdaltools/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](pdaltools/count_occurences/count_occurences_for_attribute.py): count occurences in one or several files and save the result in a json file.
    * [merge_occurences_counts.py](pdaltools/count_occurences/merge_occurences_counts.py): merge counts from several results of [count_occurences_for_attribute](pdaltools/count_occurences/count_occurences_for_attribute.py) (json files) into a single json file (used for parallelization)
* [replace_attribute_in_las.py](test/test_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.

## Unlock

[unlock_file.py](pdaltools/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](pdaltools/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](pdaltools/_version.py`)

Please log your changes in [CHANGELOG.md](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](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`

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ign-pdal-tools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Guillaume Liegard <guillaume.liegard@ign.fr>",
    "download_url": "https://files.pythonhosted.org/packages/ec/09/aa043ea4e2924839935d3790a2ff485f5fbc965ca07bd06d1ab850066d6c/ign_pdal_tools-1.12.2.tar.gz",
    "platform": null,
    "description": "# ign-pdal-tools\n\nThis repo contains various python tools based on [PDAL](https://pdal.io/) that are used to work on\nLiDAR data in the [LidarHD](https://www.ign.fr/institut/lidar-hd-vers-une-nouvelle-cartographie-3d-du-territoire)\nproject at [IGN](https://www.ign.fr) (Institut National de l'Information G\u00e9ographique et Foresti\u00e8re / French National Institute of\nGeographic and Forest Information) to work on LiDAR data.\n\nWe've decided to make them available because think that they may be useful to others, but this repo\nis NOT meant to be substantially modified from community input, and may be amended/completed depending\non the fonctionalities that our team needs.\n\n# Content\n\nThis library contains pdal-based tools to:\n* **colorize** a point cloud using images from [Geoplateforme / cartes.gouv.fr](https://www.cartes.gouv.fr/) (a portal\nfrom French government providing access to aerial imagery)\n* **stitch** together LAS files using their location\n* **standardize** LAS files\n* **unlock** LAS files generated by TerraSolid\n\n# Installation / Usage\n\nThis library can be used in different ways:\n* directly from sources: `make install` creates a mamba environment with the required dependencies\n* installed with `pip` from pypi: ` pip install ign-pdal-tools`\n* used in a docker container: see documentation [Dockerfile](Dockerfile)\n\n# More details on the contained tools\n\n## Colorization\n\n* [color.py](pdaltools/color.py): Colorize a point cloud from Geoplateforme data\n\n## Las infos\n\nMisc 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:\n\n```python\nfrom pdaltools import las_infos\n\nfilename = ...\nlas_infos.las_info_metadata(filename)\n```\n\n## Point cloud infos\n\nMisc tools to get information on a point cloud (numpy array). Eg. get expected origin of a point cloud based on a square tiling:\n\n```python\nfrom pdaltools import pcd_infos\n\npoints = ...\npcd_infos.get_pointcloud_origin_from_tile_width(points, tile_width=1000)\n```\n\n\n## Stitching\n\n* [las_clip.py](pdaltools/las_clip.py): crop a LAS file using 2d bounding box\n* [las_merge.py](pdaltools/las_merge.py): merge a LAS file with its neighbors according to their filenames\n* [las_add_buffer.py](pdaltools/las_add_buffer.py): add points to a LAS file from a buffer (border) from its neighbors (using filenames to locate neighbors)\n\n**WARNING**: In `las_merge.py` and `las_add_buffer.py`, filenames are used to get the LAS files extents\nand to find neighbors.\nThe naming convention is `{prefix1}_{prefix2}_{xcoord}_{ycoord}_{postfix})}` (eg. `Semis_2021_0770_6278_LA93_IGN69.laz`).\nBy default, `xcoord` and `ycoord` are given in kilometers and the shape of the tile is 1 km * 1 km\n\n## Standardization\n\n* [standardize_format.py](pdaltools/standardize_format.py): re-write a LAS file in a standard format (see code for details)\n* [count_occurences](pdaltools/count_occurences): count occurences for each value of a given attribute in a set of LAS files (initially used for classification)\n    * [count_occurences_for_attribute.py](pdaltools/count_occurences/count_occurences_for_attribute.py): count occurences in one or several files and save the result in a json file.\n    * [merge_occurences_counts.py](pdaltools/count_occurences/merge_occurences_counts.py): merge counts from several results of [count_occurences_for_attribute](pdaltools/count_occurences/count_occurences_for_attribute.py) (json files) into a single json file (used for parallelization)\n* [replace_attribute_in_las.py](test/test_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.\n\n## Unlock\n\n[unlock_file.py](pdaltools/unlock_file.py): overwrite a LAS file in case PDAL raises this error:\n`readers.las: Global encoding WKT flag not set for point format 6 - 10.` which is due to TerraSolid\nmalformed LAS output for LAS1.4 files with point format 6 to 10.\n\n## Add points in pointcloud\n\n[add_points_in_pointcloud.py](pdaltools/add_points_in_pointcloud.py): add points from some vector files (ex: shp, geojson, ...) inside Las/Laz:\n- 2 kinds of geometries are handled:\n  - if the geometries in the vector file are points, they are added directly to the las file\n  - if the geometries are lines, points are added along this line using a `spacing` parameter\n- In case the points are 2D only, Z can be provided as a feature property (parametrized via `altitude_column`)\n- The Classification attribute for these points is parametrized via `virtual_points_classes`\n- All the other attributes are set to 0.\n\n# Dev / Build\n\n## Contribute\n\nEvery time the code is changed, think of updating the version file: [pdaltools/_version.py](pdaltools/_version.py`)\n\nPlease log your changes in [CHANGELOG.md](CHANGELOG.md)\n\nBefore committing your changes, run the precommit hooks. They can be installed to run automatically with `make install-precommit`\n\n## Tests\n\nCreate the conda environment: `make install`\n\nRun unit tests: `make testing`\n\n## Pip package\n\nTo generate a pip package and deploy it on pypi, use the [Makefile](Makefile) at the root of the repo:\n\n* `make build`: build the library\n* `make install`: install the library in an editable way (`pip -e`)\n* `make deploy` : deploy it on pypi\n\n## Docker image\n\nTo build a docker image with the library installed: `make docker-build`\n\nTo test the docker image: `make docker-test`\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Library for common LAS files manipulation with PDAL",
    "version": "1.12.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b55e5205d56475f75cf5d3228aab19db82bce9b585daa52833744743c58edb80",
                "md5": "96e1d1868a0ff035d4470dae8b17e896",
                "sha256": "7591ec0bc27ff082468d15ab8ff277e049db49767789c116493f0e63b30117b9"
            },
            "downloads": -1,
            "filename": "ign_pdal_tools-1.12.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "96e1d1868a0ff035d4470dae8b17e896",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 32290,
            "upload_time": "2025-07-16T11:41:30",
            "upload_time_iso_8601": "2025-07-16T11:41:30.794253Z",
            "url": "https://files.pythonhosted.org/packages/b5/5e/5205d56475f75cf5d3228aab19db82bce9b585daa52833744743c58edb80/ign_pdal_tools-1.12.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ec09aa043ea4e2924839935d3790a2ff485f5fbc965ca07bd06d1ab850066d6c",
                "md5": "a9ec968689b3f0dc206c914e99cf36f2",
                "sha256": "b931e5dcd6b2a0dad3155d976e145a5c8c440defd9fab5b045f9551e1a2eedaf"
            },
            "downloads": -1,
            "filename": "ign_pdal_tools-1.12.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a9ec968689b3f0dc206c914e99cf36f2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 42851,
            "upload_time": "2025-07-16T11:41:32",
            "upload_time_iso_8601": "2025-07-16T11:41:32.006300Z",
            "url": "https://files.pythonhosted.org/packages/ec/09/aa043ea4e2924839935d3790a2ff485f5fbc965ca07bd06d1ab850066d6c/ign_pdal_tools-1.12.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-16 11:41:32",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ign-pdal-tools"
}
        
Elapsed time: 1.08793s