Skip to content

Commit bb81568

Browse files
authored
Fix bug in GDALTools Assign Projection
Assign Projection uses gdalwarp, and this works correctly when a raster has no CRS assigned, however, in the case of a raster with an incorrect CRS assignment, then gdalwarp will reproject the raster instead of simply changing the assigned CRS, propagating the error. Switching the Assign Projection tool to use gdal_translate provides the intended behaviour in all situations.
1 parent 02a0ebe commit bb81568

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/plugins/GdalTools/tools/doProjection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, iface):
4242
self.iface = iface
4343

4444
self.setupUi(self)
45-
BaseBatchWidget.__init__(self, self.iface, "gdalwarp")
45+
BaseBatchWidget.__init__(self, self.iface, "gdal_translate")
4646

4747
self.inSelector.setType(self.inSelector.FILE)
4848

@@ -112,7 +112,7 @@ def fillDesiredSRSEdit(self):
112112
def getArguments(self):
113113
arguments = []
114114
if self.desiredSRSEdit.text():
115-
arguments.append("-t_srs")
115+
arguments.append("-a_srs")
116116
arguments.append(self.desiredSRSEdit.text())
117117
if self.batchCheck.isChecked():
118118
return arguments

0 commit comments

Comments
 (0)