Skip to content

Commit

Permalink
Merge pull request #950 from gioman/sagaresampling
Browse files Browse the repository at this point in the history
[processing] suggests to use different parameters with resampling in SAGA and to use the highest resolution when using SAGA raster calculator
  • Loading branch information
volaya committed Oct 20, 2013
2 parents b7cdf5f + c645342 commit 54c576f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/processing/saga/SagaAlgorithm.py
Expand Up @@ -193,7 +193,7 @@ def addToResamplingExtent(self, layer, first):
self.xmax = max(self.xmax, layer.extent().xMaximum())
self.ymin = min(self.ymin, layer.extent().yMinimum())
self.ymax = max(self.ymax, layer.extent().yMaximum())
self.cellsize = max(self.cellsize, cellsize)
self.cellsize = min(self.cellsize, cellsize)
self.inputExtentsCount += 1

def processAlgorithm(self, progress):
Expand Down Expand Up @@ -430,14 +430,14 @@ def resampleRasterLayer(self, layer):
saga208 = ProcessingConfig.getSetting(SagaUtils.SAGA_208)
if isWindows() or isMac() or not saga208:
s = 'grid_tools "Resampling" -INPUT "' + inputFilename \
+ '" -TARGET 0 -SCALE_UP_METHOD 4 -SCALE_DOWN_METHOD 4 -USER_XMIN ' \
+ '" -TARGET 0 -SCALE_UP_METHOD 0 -SCALE_DOWN_METHOD 0 -USER_XMIN ' \
+ str(self.xmin) + ' -USER_XMAX ' + str(self.xmax) \
+ ' -USER_YMIN ' + str(self.ymin) + ' -USER_YMAX ' \
+ str(self.ymax) + ' -USER_SIZE ' + str(self.cellsize) \
+ ' -USER_GRID "' + destFilename + '"'
else:
s = 'libgrid_tools "Resampling" -INPUT "' + inputFilename \
+ '" -TARGET 0 -SCALE_UP_METHOD 4 -SCALE_DOWN_METHOD 4 -USER_XMIN ' \
+ '" -TARGET 0 -SCALE_UP_METHOD 0 -SCALE_DOWN_METHOD 0 -USER_XMIN ' \
+ str(self.xmin) + ' -USER_XMAX ' + str(self.xmax) \
+ ' -USER_YMIN ' + str(self.ymin) + ' -USER_YMAX ' \
+ str(self.ymax) + ' -USER_SIZE ' + str(self.cellsize) \
Expand Down

0 comments on commit 54c576f

Please sign in to comment.