Bug report #13081
Zonal Statistics miscalculates when handling polygons without raster cells within its boundaries
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||worksforme|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21149|
I believe the title says it all.
Working with the attached sample data, Zonal Statistics ended up calculating means, medians etc. for polygons (no apparent geometry issues) that have no valid raster cells underneath. Note, however, that this does not happen all the time since some returns were indeed NULL (as they should be). One indicator for faulty results is clearly that count returns floats instead of integers.
Except for this, the plugin worked fine - thanks again for expanding its options. Hopefully, this can be resolved quickly.
#1 Updated by Giovanni Manghi over 5 years ago
- Category set to 115
- Priority changed from Normal to High
- Affected QGIS version changed from 2.10.0 to master
- Crashes QGIS or corrupts data changed from No to Yes
This is confirmed to affect the core c++ plugin, while the same tool in the Processing toolbox seems ok.
#2 Updated by Alexander Bruy about 5 years ago
- Tag deleted (
In fact almost all polygons in the attached dataset have raster within their boundaries, but this is NODATA value. Even plogon in the middle of the raster has wrong statistics.
And I can not reproduce this bug with clipped part of the attached raster/vector layers.