enable_s_srs.diff

Proposed patch - Alexander Bruy, 2010-10-25 02:03 AM

Download (1.96 KB)

View differences:

python/plugins/GdalTools/tools/doWarp.py (working copy)
44 44
        ]
45 45
      )
46 46

  
47
      self.connect(self.inputLayerCombo, SIGNAL("currentIndexChanged(int)"), self.fillSourceSRSEditDefault)
47 48
      self.connect(self.selectInputFileButton, SIGNAL("clicked()"), self.fillInputFile)
48 49
      self.connect(self.selectOutputFileButton, SIGNAL("clicked()"), self.fillOutputFileEdit)
49 50
      self.connect(self.selectSourceSRSButton, SIGNAL("clicked()"), self.fillSourceSRSEdit)
......
101 102
      Utils.FileFilter.setLastUsedRasterFilter(lastUsedFilter)
102 103

  
103 104
      # get SRS for source file if necessary and possible
104
      self.sourceSRSEdit.setText( Utils.getRasterSRS( self, inputFile ) )
105
      crs = Utils.getRasterSRS( self, inputFile )
106
      if not crs.isEmpty():
107
        self.sourceSRSEdit.setText( Utils.getRasterSRS( self, inputFile ) )
108
        self.sourceSRSCheck.setChecked( True )
105 109

  
106 110
      self.inputLayerCombo.setCurrentIndex(-1)
107 111
      self.inputLayerCombo.setEditText(inputFile)
......
144 148
      if dialog.exec_():
145 149
        self.sourceSRSEdit.setText(dialog.getProjection())
146 150

  
151
  def fillSourceSRSEditDefault(self, index):
152
      if index >= 0 and index in self.layers:
153
        layer = self.layers[index]
154
        self.sourceSRSEdit.setText("EPSG:" + str(layer.srs().epsg()))
155
        self.sourceSRSCheck.setChecked( True )
156

  
147 157
  def fillTargetSRSEdit(self):
148 158
      dialog = SRSDialog( "Select the target SRS" )
149 159
      if dialog.exec_():
......
164 174
        arguments << "-wm"
165 175
        arguments << str(self.cacheSpin.value())
166 176
      if self.resizeGroupBox.isChecked():
167
       	arguments << "-ts"
177
        arguments << "-ts"
168 178
        arguments << str( self.widthSpin.value() )
169 179
        arguments << str( self.heightSpin.value() )
170 180
      if self.multithreadCheck.isChecked():