Skip to main content

Rasterize point cloud data in parallel

Project description

PC Rasterize: Rasterize Point Clouds in Parallel


How to use:

import pc_rasterize as pcr
import glob

files = sorted(glob.glob("../data/points/*.laz"))
# Create a GeoBox grid specification with a 100m buffer around data
geobox = pcr.build_geobox(files, resolution=0.50, crs="5070", buffer=100)
# Build a lazy CHM raster
chm = pcr.rasterize(
    files,
    geobox,
    cell_func="max",
    # Set custom dask chunk-size
    chunksize=(500, 500),
    nodata=np.nan,
    # Filter out points over 100m
    pdal_filters=[
        {
            "type": "filters.expression",
            "expression": "Z < 100"
        }
    ],
)

Saving with default dask scheduling:

# Use rioxarray to save to disk
chm.rio.to_raster("points_chm.tiff", tiled=True)

Saving with dask's more advanced scheduling:

Dask's more advanced 'distributed' scheduling also provides a dashboard at http://localhost:8787/status for viewing progress in your browser.

from dask.distributed import Client, LocalCluster, Lock

with LocalCluster() as cluster, Client(cluster) as client:
    chm.rio.to_raster("points_chm.tiff", tiled=True, lock=Lock("rio"))

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

pc_rasterize-0.2.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

pc_rasterize-0.2.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file pc_rasterize-0.2.0.tar.gz.

File metadata

  • Download URL: pc_rasterize-0.2.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for pc_rasterize-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6baa7894d273cad03c48e1ac456d08fb94fb1d50174640e076a69ef945908abd
MD5 5a54f322d15d8d38d0bdb54690fcdf6c
BLAKE2b-256 f0487a5af76726b4a012e9ed1c7276a8b95864ae66597fb377f299afebf6fec3

See more details on using hashes here.

File details

Details for the file pc_rasterize-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pc_rasterize-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for pc_rasterize-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84daa2bd3b1117b87f40d9910cb4ffcbe46d63cf0f38bca2cd0a232bcf20a85d
MD5 10e00afa38d8c487752b11dcffc5caa9
BLAKE2b-256 d38b6e9eabdbce5c5beef14dd7d2cac3259141036981b8a240506a1cf23ec5dc

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page