mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[processing] remove code with GDAL 1.x API as QGIS 3 will require GDAL 2.x
This commit is contained in:
parent
5489f855a7
commit
f66646c483
@ -90,10 +90,9 @@ class warp(GdalAlgorithm):
|
||||
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 @@ class warp(GdalAlgorithm):
|
||||
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))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user