@@ -103,67 +103,9 @@ def defineCharacteristicsFromFile(self):
103
103
raise e
104
104
lines .close ()
105
105
106
- #=======================================================================
107
- # self.xmin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMIN)
108
- # self.xmax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMAX)
109
- # self.ymin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMIN)
110
- # self.ymax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMAX)
111
- # extentString = str(self.xmin) + "," + str(self.xmax) + str(self.xmin) + "," + str(self.xmax)
112
- # self.cellsize = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_CELLSIZE)
113
- #=======================================================================
114
106
self .addParameter (ParameterExtent (self .GRASS_REGION_EXTENT_PARAMETER , "GRASS region extent" ))
115
107
self .addParameter (ParameterNumber (self .GRASS_REGION_CELLSIZE_PARAMETER , "GRASS region cellsize" , 0 , None , 1 ))
116
108
117
- #===============================================================================
118
- # def calculateRegion(self):
119
- # auto = SextanteConfig.getSetting(GrassUtils.GRASS_AUTO_REGION)
120
- # if auto:
121
- # try:
122
- # self.cellsize = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_CELLSIZE)
123
- # except Exception:
124
- # self.cellsize = 0;
125
- # first = True;
126
- # for param in self.parameters:
127
- # if param.value:
128
- # if isinstance(param, (ParameterRaster, ParameterVector)):
129
- # if isinstance(param.value, (QgsRasterLayer, QgsVectorLayer)):
130
- # layer = param.value
131
- # else:
132
- # layer = QGisLayers.getObjectFromUri(param.value)
133
- # self.addToRegion(layer, first)
134
- # first = False
135
- # elif isinstance(param, ParameterMultipleInput):
136
- # layers = param.value.split(";")
137
- # for layername in layers:
138
- # layer = QGisLayers.getObjectFromUri(layername, first)
139
- # self.addToRegion(layer, first)
140
- # first = False
141
- # if self.cellsize == 0:
142
- # self.cellsize = 1
143
- # else:
144
- # self.xmin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMIN)
145
- # self.xmax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_XMAX)
146
- # self.ymin = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMIN)
147
- # self.ymax = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_YMAX)
148
- # self.cellsize = SextanteConfig.getSetting(GrassUtils.GRASS_REGION_CELLSIZE)
149
- #
150
- #
151
- # def addToRegion(self, layer, first):
152
- # if first:
153
- # self.xmin = layer.extent().xMinimum()
154
- # self.xmax = layer.extent().xMaximum()
155
- # self.ymin = layer.extent().yMinimum()
156
- # self.ymax = layer.extent().yMaximum()
157
- # if isinstance(layer, QgsRasterLayer):
158
- # self.cellsize = (layer.extent().xMaximum() - layer.extent().xMinimum())/layer.width()
159
- # else:
160
- # self.xmin = min(self.xmin, layer.extent().xMinimum())
161
- # self.xmax = max(self.xmax, layer.extent().xMaximum())
162
- # self.ymin = min(self.ymin, layer.extent().yMinimum())
163
- # self.ymax = max(self.ymax, layer.extent().yMaximum())
164
- # if isinstance(layer, QgsRasterLayer):
165
- # self.cellsize = max(self.cellsize, (layer.extent().xMaximum() - layer.extent().xMinimum())/layer.width())
166
- #===============================================================================
167
109
168
110
def processAlgorithm (self , progress ):
169
111
if SextanteUtils .isWindows ():
@@ -327,18 +269,3 @@ def getTempFilename(self):
327
269
328
270
def commandLineName (self ):
329
271
return "grass:" + self .name [:self .name .find (" " )]
330
-
331
- #===============================================================================
332
- # def checkBeforeOpeningParametersDialog(self):
333
- # for param in self.parameters:
334
- # if isinstance(param, (ParameterRaster, ParameterVector)):
335
- # return None
336
- # if isinstance(param, ParameterMultipleInput):
337
- # if not param.optional:
338
- # return None
339
- #
340
- # if SextanteConfig.getSetting(GrassUtils.GRASS_AUTO_REGION):
341
- # return "This algorithm cannot be run with the 'auto-region' setting\nPlease set a GRASS region before running it"
342
- # else:
343
- # return None
344
- #===============================================================================
0 commit comments