You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aggregations can be specified using a string representing an aggregation method available as DataArray/Dataset or *GroupBy methods like DataArray.mean, DataArray.min or DataArray.max. Alternatively, you can pass a callable accepted by DataArray/Dataset.reduce. Alternatively, you can pass a tuple in a format (name, func) where name is used as a coordinate and func is either known string as above or a callable, or (name, func, {kwargs}), if you need to pass additional keyword arguments.
With categorical data you will probably need to turn the categories to a dimension on its own and return counts per unique category, which I am not certain you can achieve with a custom func. But it should not be too complicated to implement that, we have a similar logic for quantiles for example if you want to report multiple.
I just had someone ask about zonal_stats with a categorical raster where the only "stat" that makes sense is a count (or perhaps area). Example: https://pythonhosted.org/rasterstats/manual.html?highlight=categorical#working-with-categorical-rasters
Is this supported or straightforward to implement?
The text was updated successfully, but these errors were encountered: