Skip to content
Permalink
Browse files

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 2ce4b8a7d0d38a28cb0ab6fc00554486dcfc7022
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 2ce4b8a

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