ZonalStatistics uses rasterization to count pixel values. Yes, in the current implementation, only pixels that have their centroid inside a polygon are used (we use GDAL algorithm for rasterization with
In your case, the current implementation of
ZonalStatistics is not well suited because your polygons are smaller than your pixels. The
ZonalStatistics application is quite recent, and we might improve it a bit! For instance, enabling the user to chose
ALL_TOUCHED, or something else (see the proposed workaround below).
In exchange of a quick workaround for your problem, it could be nice that you could provide a minimal example of this bug you found . Like providing a small subset of your image with some polygons that cause the issue. For that, if you want, you can open an issue on the Gitlab instance.
Since rasterization is used, and you need pixels smaller than the polygons, one trick consist to upsample your image.
If you like python, you can develop a mini-pipeline that chains
Orthorectification (to change the pixel spacing) and
ZonalStatistics to do that (see the OTB python api doc).
Or, you can use
Orthorectification to resample the image prior to use
ZonalStatistics but this would write huge temporary files and would be also slower.
Hope this workaround will help you! And that you will help us to improve the app in return