Registry / analytics / exactextract

exactextract

JSON →
library0.3.0pypypi✓ verified 85d ago

Fast and accurate raster zonal statistics extraction from rasters using polygon geometries. Version 0.3.0 (pre-1.0), active development. Monthly or quarterly releases.

pip install exactextract
INSTALL
IMPORT
SIG · EXACTEXTRACT
E
exactextract
analyticspythonv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

exact_extract
from exactextract import exact_extract
from exactextract.raster import exact_extract
wrong path, exact_extract is a top-level function

Extract zonal statistics from a raster using polygon geometries.

from exactextract import exact_extract import geopandas as gpd import rasterio # Load raster with rasterio.open('raster.tif') as src: raster = src.read(1) affine = src.transform # Load polygons gdf = gpd.read_file('polygons.shp') # Run zonal stats results = exact_extract(raster, affine, gdf.geometry, ops=['mean', 'sum']) print(results)
Debug
Known issues
gotchaThe `exact_extract` function expects raw numpy arrays and affine transforms, not file paths. Use rasterio or similar to load the raster data first.
fix
Load raster using rasterio.open() and pass the array and transform directly.
affects: *
gotchaGeometries must be in the same coordinate reference system (CRS) as the raster. No automatic reprojection is performed.
fix
Ensure vector geometries are reprojected to match the raster CRS using geopandas.to_crs() before calling exact_extract.
affects: *
deprecatedThe `extract` function is deprecated in favor of `exact_extract`.
fix
Use `from exactextract import exact_extract` instead.
affects: <0.3.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'exactextract'
Library not installed or installed in a different environment.
fix
Run `pip install exactextract` in the target Python environment.
ValueError: Input raster and features must have the same CRS
Polygons and raster have different coordinate reference systems.
fix
Reproject the vector features to match the raster CRS using gdf = gdf.to_crs(raster_crs).
TypeError: exact_extract() got an unexpected keyword argument 'ops'
The `ops` parameter was introduced in version 0.2.0; using older version.
fix
Upgrade to exactextract >=0.2.0: `pip install --upgrade exactextract`.
Upgrade
Version history
0.3.0latest on PyPI · released Dec 1, 2025
Audit
Dependencies
numpyrequiredarray operations
rasteriooptionalraster I/O
geopandasoptionalvector I/O
shapelyoptionalgeometry operations
Agent activity
31 hits · last 30 days
node
29
OpenAI (training)
1
Resources
exactextract — pip install exactextract · libregistry