Skip to main content

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"))

Release files for pc-rasterize 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pc-rasterize 0.2.0
File Size Uploaded
pc_rasterize-0.2.0.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pc-rasterize 0.2.0
File Interpreter ABI Platform
pc_rasterize-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.4 kB

Release files / pc_rasterize-0.2.0.tar.gz

Download URL pc_rasterize-0.2.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6baa7894d273cad03c48e1ac456d08fb94fb1d50174640e076a69ef945908abd
BLAKE2b-256 checksum
How to use checksums
f0487a5af76726b4a012e9ed1c7276a8b95864ae66597fb377f299afebf6fec3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / pc_rasterize-0.2.0-py3-none-any.whl

Download URL pc_rasterize-0.2.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84daa2bd3b1117b87f40d9910cb4ffcbe46d63cf0f38bca2cd0a232bcf20a85d
BLAKE2b-256 checksum
How to use checksums
d38b6e9eabdbce5c5beef14dd7d2cac3259141036981b8a240506a1cf23ec5dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page