We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26c3ece commit 44c948bCopy full SHA for 44c948b
python/plugins/processing/tools/raster.py
@@ -64,8 +64,14 @@ def scanraster(layer, progress):
64
65
66
def mapToPixel(mX, mY, geoTransform):
67
- (pX, pY) = gdal.ApplyGeoTransform(
68
- gdal.InvGeoTransform(geoTransform)[1], mX, mY)
+ try:
+ # GDAL 1.x
69
+ (pX, pY) = gdal.ApplyGeoTransform(
70
+ gdal.InvGeoTransform(geoTransform)[1], mX, mY)
71
+ except TypeError:
72
+ # GDAL 2.x
73
74
+ gdal.InvGeoTransform(geoTransform), mX, mY)
75
return (int(pX), int(pY))
76
77
0 commit comments