Create zonal statistics tools for xarray.* data structures to allow summaries of input rasters and cubes or of predictions (or inputs), where zones are defined by grids or polygon
[ ] GeoJSON
[ ] Shapefiles
[ ] NetCDF files or other files supported by xarray/earthio/xarray_filters
I think the best term for those is "zonal_mask" (correct me if I'm wrong) and where the zonal mask sets the grouping regions for spatial statistics.
Consider (for each of the files' above typical data structures), how to use the polygons from file. For example, geojson and shapefiles have typically >1 polygon, so some things to think about are:
[ ] Do zonal statistics by all ID's in the file - report zonal summary stats for every polygon in file
[ ] Allowing stats by just one ID in the file
[ ] Anything we can do to help with combining overlapping or other multi-polygon/ multi-layer information sets, e.g. constructing a zonal mask from logical expression over several files that have multiple polygons
Note in xarray_filters.polygon_tools there is some numba related point-in-polygon code that will be helpful for zonal stats on scattered datasets, but this issue should focus on raster or spatial ND arrays (regular grids not scattered points) that are masked by polygon layers.
Create zonal statistics tools for
xarray.*
data structures to allow summaries of input rasters and cubes or of predictions (or inputs), where zones are defined by grids or polygonxarray
/earthio
/xarray_filters
I think the best term for those is "zonal_mask" (correct me if I'm wrong) and where the zonal mask sets the grouping regions for spatial statistics.
Consider (for each of the files' above typical data structures), how to use the polygons from file. For example, geojson and shapefiles have typically >1 polygon, so some things to think about are:
Note in
xarray_filters.polygon_tools
there is some numba related point-in-polygon code that will be helpful for zonal stats on scattered datasets, but this issue should focus on raster or spatial ND arrays (regular grids not scattered points) that are masked by polygon layers.