Bug report #11135
Zonal Statistics is calculating wrong mean values
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||19463|
the Zonal Statistics tool doesn't work correctly (wrong MEAN value). Here is a link to the Forum-question: [[http://gis.stackexchange.com/questions/112435/is-there-an-issue-with-zonal-statistics-calculating-wrong-mean-values]]
I'm using QGIS 2.2.
Fix calculation of zonal stats when source contains nodata or nan
pixels (fix #11135)
#1 Updated by Giovanni Manghi almost 7 years ago
- File rast2.tif added
- Category set to 94
- Affected QGIS version changed from 2.4.0 to master
I can confirm this on the latest master, where both the tool in the raster menu and in the processing toolbox (one C++ and the other python) make the same error and give the wrong result.
The provided test raster has no data areas and once transformed them into 0 then the zonal stats tool returns the same mean value, meaning that it seems no data is taken into account as 0.
Please notice also that:
with the processing tool and the provided sample raster the "min" and "max" values do not make any sense (and it seems to give the wrong values with any input raster)
other computed values too, both with the processing tool and the C++ plugin seems odd.
#7 Updated by Spencer Gardner over 4 years ago
- Status changed from Closed to Reopened
I'm seeing a regression in this on 2.18.3 in Linux. There are no Zonal Statistics in the Raster menu, but the Processing routine seems to be having the same problem as described above. Is this a bad implementation in processing now? If so, I'll open a new bug.