Skip to content

Commit

Permalink
[sextante] removed "lib" prefix in saga calls
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Jul 9, 2013
1 parent 7ccd3d0 commit 1c2e49e
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions python/plugins/sextante/saga/SagaAlgorithm.py
Expand Up @@ -234,11 +234,9 @@ def processAlgorithm(self, progress):
raise GeoAlgorithmExecutionException("Unsupported file format")

#2: set parameters and outputs
if SextanteUtils.isWindows() or SextanteUtils.isMac():
command = self.undecoratedGroup + " \"" + self.cmdname + "\""
else:
command = "lib" + self.undecoratedGroup + " \"" + self.cmdname + "\""


command = self.undecoratedGroup + " \"" + self.cmdname + "\""

if self.hardcodedStrings:
for s in self.hardcodedStrings:
command += " " + s
Expand Down Expand Up @@ -300,11 +298,9 @@ def processAlgorithm(self, progress):
for out in self.outputs:
if isinstance(out, OutputRaster):
filename = out.getCompatibleFileName(self)
filename2 = SextanteUtils.tempFolder() + os.sep + os.path.basename(filename) + ".sgrd"
if SextanteUtils.isWindows() or SextanteUtils.isMac():
commands.append("io_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 4 -TYPE 0 -FILE \"" + filename + "\"");
else:
commands.append("libio_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 4 -TYPE 0 -FILE \"" + filename + "\"");
filename2 = SextanteUtils.tempFolder() + os.sep + os.path.basename(filename) + ".sgrd"
commands.append("io_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 4 -TYPE 0 -FILE \"" + filename + "\"");


#4 Run SAGA
SagaUtils.createSagaBatchJobFileFromSagaCommands(commands)
Expand Down Expand Up @@ -336,14 +332,9 @@ def resampleRasterLayer(self,layer):
inputFilename = layer
destFilename = SextanteUtils.getTempFilename("sgrd")
self.exportedLayers[layer]= destFilename
if SextanteUtils.isWindows() or SextanteUtils.isMac():
s = "grid_tools \"Resampling\" -INPUT \"" + inputFilename + "\" -TARGET 0 -SCALE_UP_METHOD 4 -SCALE_DOWN_METHOD 4 -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 " +\
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 + "\""
s = "grid_tools \"Resampling\" -INPUT \"" + inputFilename + "\" -TARGET 0 -SCALE_UP_METHOD 4 -SCALE_DOWN_METHOD 4 -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 + "\""
return s


Expand Down

0 comments on commit 1c2e49e

Please sign in to comment.