Skip to content
Permalink
Browse files

[Processing] Fix TypeError in Zonal Statistics algorithm

Fixes #14412
  • Loading branch information
radosuav authored and alexbruy committed Mar 9, 2016
1 parent 107d30a commit 29bf95cf42f2a05cc32d8159232597b92143fae9
Showing with 8 additions and 2 deletions.
  1. +8 −2 python/plugins/processing/tools/raster.py
@@ -64,8 +64,14 @@ def scanraster(layer, progress):


def mapToPixel(mX, mY, geoTransform):
(pX, pY) = gdal.ApplyGeoTransform(
gdal.InvGeoTransform(geoTransform)[1], mX, mY)
try:
# GDAL 1.x
(pX, pY) = gdal.ApplyGeoTransform(
gdal.InvGeoTransform(geoTransform)[1], mX, mY)
except TypeError:
# GDAL 2.x
(pX, pY) = gdal.ApplyGeoTransform(
gdal.InvGeoTransform(geoTransform), mX, mY)
return (int(pX), int(pY))


0 comments on commit 29bf95c

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