Skip to main content

Rasterize point cloud data

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

Uploaded Source

Built Distribution

pc_rasterize-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pc_rasterize-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0abbf56c98918d968d1f69853f30c07500bfa74308e820bc8019099bad8a1221
MD5 edba70803a4560c2849e48e99fbe8c19
BLAKE2b-256 5609f50fff1bd67f1c37b8496b61d7469abcdeca874fad3908d984e189dda9b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pc_rasterize-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2c16e0199d56cf9b84af346e109d5048e75ff3f90847f2641fcb986346bd1d2
MD5 d93db84c47f92570e23d30d6ba453a2e
BLAKE2b-256 5e12764c9e3bce8b2431b9fcbfad5a1cb95ce0ab243ded2bbbb30923de4c333a

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