mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-22 00:06:12 -05:00
[processing] add support for GDAL 2.x in raster tools (refs #14858)
This commit is contained in:
parent
26c3ece49e
commit
44c948b014
@ -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))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user