Skip to content
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

Allow fractional pixels when generating input shapefile masks #54

Open
jonschwenk opened this issue Mar 3, 2022 · 0 comments
Open

Allow fractional pixels when generating input shapefile masks #54

jonschwenk opened this issue Mar 3, 2022 · 0 comments

Comments

@jonschwenk
Copy link

The ability to create masks from input shapefiles is very welcome, but we ran into an issue that I think can be fairly easily resolved. It seems that the masking procedure considers each pixel either "all in" or "all out", i.e. binary. In the case where a polygon is on the order of the pixel size of the raster being sampled, e.g.

image,

it would be great for the mask pixels to take fractional values (i.e. not binary), where the value represents the fraction of the pixel that is covered by the polygon. Then (if not already implemented), the mask can be used as a weights grid when doing the spatial aggregations for any raster.

We have a number of smaller watersheds that might overlap 2-4 pixels for coarser datasets and would appreciate this kind of precise zonal statistics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant