raptor-stats
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
- Author: Simon Pedro Gonzalez.
- This package is based on the following project, where you can read more about the zonal stats problem, methods and performance comparison.
- This package API is inspired in the rasterstats package by Matthew Perry.
Metadata
Release files for raptor-stats 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| raptor_stats-0.0.5.tar.gz | 27.0 kB | Without provenance | Details for raptor_stats-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| raptor_stats-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for raptor_stats-0.0.5-py3-none-any.whl |
Total release size: 50.2 kB
Release files / raptor_stats-0.0.5.tar.gz
| Download URL | raptor_stats-0.0.5.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b26c134b371ed3cc6b25bcc9b7829188ae4549331357ba21a3fe6b58b7da2240
|
|
BLAKE2b-256 checksum How to use checksums |
422395418328efc8ea3097e4791ce6c041ea997e05ef61cff7138b429a82e259
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / raptor_stats-0.0.5-py3-none-any.whl
| Download URL | raptor_stats-0.0.5-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d44fb7dfd24691ecd89fdec99a5aeff10ae506721f806068d27c95575997187
|
|
BLAKE2b-256 checksum How to use checksums |
2ccbfe9eb447f3bf399118fdcf1ac720b87476f9ce7f483d5cf160267b5f9c5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for raptor-stats 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.