Skip to content

Commit 29bf95c

Browse files
radosuavalexbruy
authored andcommittedMar 9, 2016
[Processing] Fix TypeError in Zonal Statistics algorithm
Fixes #14412
1 parent 107d30a commit 29bf95c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎python/plugins/processing/tools/raster.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,14 @@ def scanraster(layer, progress):
6464

6565

6666
def mapToPixel(mX, mY, geoTransform):
67-
(pX, pY) = gdal.ApplyGeoTransform(
68-
gdal.InvGeoTransform(geoTransform)[1], mX, mY)
67+
try:
68+
# GDAL 1.x
69+
(pX, pY) = gdal.ApplyGeoTransform(
70+
gdal.InvGeoTransform(geoTransform)[1], mX, mY)
71+
except TypeError:
72+
# GDAL 2.x
73+
(pX, pY) = gdal.ApplyGeoTransform(
74+
gdal.InvGeoTransform(geoTransform), mX, mY)
6975
return (int(pX), int(pY))
7076

7177

0 commit comments

Comments
 (0)
Please sign in to comment.