I have been trying to use the QGIS zonal statistics plugin. My raster has a nodata value of -99999 and all other values are positive. After computing the mean zonal statistics there are a number of features that have a negative mean indicating that the Zonal Stats plugin must be included nodata values in the calculations. Is there a workaround for this or am I doing something wrong:
from qgis.analysis import QgsZonalStatistics
vectorLayer = qgis.utils.iface.activeLayer()
rasterLayer = "path/to/my/raster/et_30.tif"
prefix = 'Test'
zoneStat = QgsZonalStatistics(vectorLayer, rasterLayer,prefix)
zoneStat.calculateStatistics(None)