Skip to content
Permalink
Browse files

Merge pull request #2516 from radosuav/zonal_stats

[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 17bd46e5be372ab0777551375000cca6006f88f6
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 17bd46e

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