Skip to content

geohalo

This may not be the fastest way to put a gridded field onto polygons, but it is a correct one — and after the first build, it is also the fast one.

geohalo computes exact-fractional-area zonal statistics over regular lat/lon grids. Give it any gridded field — temperature, precipitation, population density, a land-cover fraction, a satellite band — loaded with xarray from GRIB, NetCDF, Zarr, … — and an arbitrary set of polygons, and it reduces the spatial dimensions of the grid to one value per polygon, with sub-cell precision and millisecond-scale aggregation in the hot path.

The expensive geometric work happens once. Every subsequent grid — every time step, ensemble member, scenario, or band — collapses to a single sparse · dense matmul.

Documentation