Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.22 KB

index.rst

File metadata and controls

39 lines (27 loc) · 1.22 KB

xagg

A package to aggregate gridded data in :pyxarray to polygons in :pygeopandas using area-weighting from the relative area overlaps between pixels and polygons.

The simplest code run, involving raster data in an :pyxarray :pyDataset ds and polygons in a :pygeopandas :pyGeoDataFrame gpd, is:

import xagg as xa

# Get overlap between pixels and polygons
weightmap = xa.pixel_overlaps(ds,gdf)

# Aggregate data in [ds] onto polygons
aggregated = xa.aggregate(ds,weightmap)

:pyaggregated can then be turned into an :pyxarray :pyDataset, a :pygeopandas :pyGeoDataFrame, or directly exported to a CSV (for use in, e.g., STATA), NetCDF, or Shapefile.

intro installation notebooks/base_run notebooks/full_run.ipynb tips modules

Indices and tables

  • genindex
  • modindex
  • search