perrygeo/python-rasterstats

If polygons smaller than a pixel, stats not computed

Havi-muro opened this issue · 1 comments

I've found that for the polygons that happen to be smaller than the image pixel, zonal_stats returns empty results. Although there are other packages to extract pixel values from points, in my case I have polygons of multiple sizes. If a polygon is larger than the pixel I need the zonal stats, but if it is smaller, just the pixel value would do. I suppose that it would be fairly easy to change (if min=max, just return one value). Thanks for this awesome package! Much faster than R.
image