Index: python/plugins/GdalTools/tools/doWarp.py =================================================================== --- python/plugins/GdalTools/tools/doWarp.py (revision 14431) +++ python/plugins/GdalTools/tools/doWarp.py (working copy) @@ -44,6 +44,7 @@ ] ) + self.connect(self.inputLayerCombo, SIGNAL("currentIndexChanged(int)"), self.fillSourceSRSEditDefault) self.connect(self.selectInputFileButton, SIGNAL("clicked()"), self.fillInputFile) self.connect(self.selectOutputFileButton, SIGNAL("clicked()"), self.fillOutputFileEdit) self.connect(self.selectSourceSRSButton, SIGNAL("clicked()"), self.fillSourceSRSEdit) @@ -101,7 +102,10 @@ Utils.FileFilter.setLastUsedRasterFilter(lastUsedFilter) # get SRS for source file if necessary and possible - self.sourceSRSEdit.setText( Utils.getRasterSRS( self, inputFile ) ) + crs = Utils.getRasterSRS( self, inputFile ) + if not crs.isEmpty(): + self.sourceSRSEdit.setText( Utils.getRasterSRS( self, inputFile ) ) + self.sourceSRSCheck.setChecked( True ) self.inputLayerCombo.setCurrentIndex(-1) self.inputLayerCombo.setEditText(inputFile) @@ -144,6 +148,12 @@ if dialog.exec_(): self.sourceSRSEdit.setText(dialog.getProjection()) + def fillSourceSRSEditDefault(self, index): + if index >= 0 and index in self.layers: + layer = self.layers[index] + self.sourceSRSEdit.setText("EPSG:" + str(layer.srs().epsg())) + self.sourceSRSCheck.setChecked( True ) + def fillTargetSRSEdit(self): dialog = SRSDialog( "Select the target SRS" ) if dialog.exec_(): @@ -164,7 +174,7 @@ arguments << "-wm" arguments << str(self.cacheSpin.value()) if self.resizeGroupBox.isChecked(): - arguments << "-ts" + arguments << "-ts" arguments << str( self.widthSpin.value() ) arguments << str( self.heightSpin.value() ) if self.multithreadCheck.isChecked():