Skip to content
Permalink
Browse files

[Processing] Use raster band scailing factor and offset in Zonal Stat…

…istics algorithm
  • Loading branch information
radosuav
radosuav committed Nov 30, 2015
1 parent 57eb409 commit 34df72c75b18a5b34ad65dd2ea6894ed0c07b072
Showing with 2 additions and 0 deletions.
  1. +2 −0 python/plugins/processing/algs/qgis/ZonalStatistics.py
@@ -118,6 +118,7 @@ def processAlgorithm(self, progress):

srcOffset = (startColumn, startRow, width, height)
srcArray = rasterBand.ReadAsArray(*srcOffset)
srcArray = srcArray*rasterBand.GetScale()+rasterBand.GetOffset()

newGeoTransform = (
geoTransform[0] + srcOffset[0] * geoTransform[1],
@@ -192,6 +193,7 @@ def processAlgorithm(self, progress):

srcOffset = (startColumn, startRow, width, height)
srcArray = rasterBand.ReadAsArray(*srcOffset)
srcArray = srcArray*rasterBand.GetScale()+rasterBand.GetOffset()

newGeoTransform = (
geoTransform[0] + srcOffset[0] * geoTransform[1],

0 comments on commit 34df72c

Please sign in to comment.
You can’t perform that action at this time.