Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2883 from radosuav/zonal_statistics_fix
[Processing] Fix TypeError in Zonal Statistics algorithm
  • Loading branch information
volaya committed Mar 9, 2016
2 parents 5bb1723 + 9c611c9 commit 2ce4b8a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/plugins/processing/tools/raster.py
Expand Up @@ -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))


Expand Down

0 comments on commit 2ce4b8a

Please sign in to comment.