Skip to content
Permalink
Browse files

[processing] remove code with GDAL 1.x API as QGIS 3 will require GDA…

…L 2.x
  • Loading branch information
alexbruy committed Feb 9, 2017
1 parent 5489f85 commit f66646c48395739234d5e52b4728663c43001db8
Showing with 8 additions and 16 deletions.
  1. +6 −8 python/plugins/processing/algs/gdal/warp.py
  2. +2 −8 python/plugins/processing/tools/raster.py
@@ -90,10 +90,9 @@ def defineCharacteristics(self):
self.tr('Raster extent'),
optional=True))

if GdalUtils.version() >= 2000000:
self.addParameter(ParameterCrs(self.EXT_CRS,
self.tr('CRS of the raster extent, leave blank for using Destination SRS'),
optional=True))
self.addParameter(ParameterCrs(self.EXT_CRS,
self.tr('CRS of the raster extent, leave blank for using Destination SRS'),
optional=True))

self.addParameter(ParameterString(self.OPTIONS,
self.tr('Additional creation options'),
@@ -151,10 +150,9 @@ def getConsoleCommands(self):
arguments.append(regionCoords[1])
arguments.append(regionCoords[3])

if GdalUtils.version() >= 2000000:
if rastext_crs:
arguments.append('-te_srs')
arguments.append(rastext_crs)
if rastext_crs:
arguments.append('-te_srs')
arguments.append(rastext_crs)

if opts:
arguments.append('-co')
@@ -104,14 +104,8 @@ def scanraster(layer, feedback):


def mapToPixel(mX, mY, geoTransform):
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)
(pX, pY) = gdal.ApplyGeoTransform(
gdal.InvGeoTransform(geoTransform), mX, mY)
return (int(pX), int(pY))


0 comments on commit f66646c

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