Skip to content

Commit

Permalink
Merge pull request #2516 from radosuav/zonal_stats
Browse files Browse the repository at this point in the history
[processing] use raster band scailing factor and offset in Zonal Statistics algorithm
  • Loading branch information
alexbruy committed Dec 1, 2015
2 parents bb9eb79 + 34df72c commit 17bd46e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/plugins/processing/algs/qgis/ZonalStatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 17bd46e

Please sign in to comment.