python-rasterstats icon indicating copy to clipboard operation
python-rasterstats copied to clipboard

If polygons smaller than a pixel, stats not computed

Open Havi-muro opened this issue 2 years ago • 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

Havi-muro avatar Aug 17 '22 07:08 Havi-muro

See https://pythonhosted.org/rasterstats/manual.html#rasterization-strategy

perrygeo avatar Oct 04 '22 00:10 perrygeo