Skip to main content

Raptor Zonal Statistics

Project description

raptor-stats

Docs: latest PyPI Python  3.12.8+ License

Compute zonal statistics using efficient Raptor (Raster+Vector) methods.

Installation

pip install raptor-stats

Usage

from raptorstats import zonal_stats

stats = zonal_stats("path/to/vector.shp", "path/to/raster.tif", method="scanline")

See the zonal_stats API docs for more details on input types and additional parameters.

Methods

  • scanline: Scans the raster file once, line by line, and computes all the intersections with the vector layer in a single pass. Suitable for fast one-time run results.
  • agqt: Builds a QuadTree with precomputed statistics, then combines it with the scanline method to answer queries more efficiently. Suitable for systems that repeatedly query changing vector layers over the same raster.

Performance

Raptor methods performance advantage increases with the size of the input raster and number of features. For example, with an ~1.9 billion pixel raster and 50 features (US states):

For the same raster, on but around 3000 features (US counties):

NOTES:

  • These tests were made on a i7-8750H (2019) 16GB RAM Linux machine.
  • The performance of the agqt method depends on the depth of the tree selected and the size of the features.

Credits

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

raptor_stats-0.0.4.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

raptor_stats-0.0.4-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file raptor_stats-0.0.4.tar.gz.

File metadata

  • Download URL: raptor_stats-0.0.4.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for raptor_stats-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ceaa33d5a7d410c1c562ebab7a4b88364c131f7c896f2f9e3c27a34318dfee58
MD5 381b5d9259634b0f37e0442d51c56b8e
BLAKE2b-256 e3666fb75d54819f3b44fd0145b2588269fe9d49ea49b6bf59224a30e89981c2

See more details on using hashes here.

File details

Details for the file raptor_stats-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: raptor_stats-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for raptor_stats-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dd6bdef198eeee44ae18d760b5caab7107bf489b6381e06eb1c14d551b5f68d0
MD5 2d074989681e34fcdd55b104c1d14fa7
BLAKE2b-256 cf34ba3827b000bd7e9753b67475f473e3a1988768eeab4e87ed26eef01ea159

See more details on using hashes here.

Supported by

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