-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: optionally return unique pixel counts under each polygon #270
Comments
We discussed this on a software team call and approved this feature without the need for a DD and understanding that Future: consider the real meaning of
|
A `Counter` object allows for succinct tallying of landuse codes, so it really makes sense to use in this case. RE:natcap#270
I'm trying to clarify the intent of the function and the created dict ... "sample" isn't a good descriptor for what's going on here. RE:natcap#270
The InVEST HRA model has a couple of columns in an output table (
R_%LOW
,R_%MED
,R_%HIGH
inSUMMARY_STATISTICS.csv
) that are derived from the pixel counts of each classification in a raster that has pixel values in the set{0, 1, 2, 3}
. As it stands, the only way to get accurate reports of this information is to basically reimplementzonal_statistics
, adding in the counting. These outputs cannot be derived from the current output ofzonal_statistics
.It would be very handy if
pygeoprocessing.zonal_statistics
allowed for pixel counts under each polygon to be reported. The assumption is that this only makes sense on discrete (integer) rasters. Recording these values on a floating-point raster could easily exhaust available memory, which is why this is best kept as an optional parameter that defaults toFalse
.I propose modifying the function signature of
pygeoprocessing.zonal_statistics
to include a new parameter,include_pixel_counts
:Using the HRA example, the return value for FID
60
would be: 11, 62, 4The text was updated successfully, but these errors were encountered: