Skip to content
Permalink
Browse files

[sextante]fix for calling SAGA under OSX

  • Loading branch information
volaya committed Apr 6, 2013
1 parent eae1a97 commit 2bfffaa51651ca137b80a3b906ffba78024a7e1d
Showing with 4 additions and 7 deletions.
  1. +4 −4 python/plugins/sextante/saga/SagaAlgorithm.py
  2. +0 −3 python/plugins/sextante/saga/SagaUtils.py
@@ -233,7 +233,7 @@ def processAlgorithm(self, progress):
raise GeoAlgorithmExecutionException("Unsupported file format")

#2: set parameters and outputs
if SextanteUtils.isWindows():
if SextanteUtils.isWindows() or SextanteUtils.isMac():
command = self.undecoratedGroup + " \"" + self.cmdname + "\""
else:
command = "lib" + self.undecoratedGroup + " \"" + self.cmdname + "\""
@@ -300,7 +300,7 @@ def processAlgorithm(self, progress):
if isinstance(out, OutputRaster):
filename = out.getCompatibleFileName(self)
filename2 = SextanteUtils.tempFolder() + os.sep + os.path.basename(filename) + ".sgrd"
if SextanteUtils.isWindows():
if SextanteUtils.isWindows() or SextanteUtils.isMac():
commands.append("io_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 1 -TYPE 0 -FILE \"" + filename + "\"");
else:
commands.append("libio_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 1 -TYPE 0 -FILE \"" + filename + "\"");
@@ -335,7 +335,7 @@ def resampleRasterLayer(self,layer):
inputFilename = layer
destFilename = SextanteUtils.getTempFilename("sgrd")
self.exportedLayers[layer]= destFilename
if SextanteUtils.isWindows():
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 + "\""
@@ -349,7 +349,7 @@ def resampleRasterLayer(self,layer):
def exportRasterLayer(self, layer):
destFilename = SextanteUtils.getTempFilenameInTempFolder(os.path.basename(layer)[0:5] + ".sgrd")
self.exportedLayers[layer]= destFilename
if SextanteUtils.isWindows():
if SextanteUtils.isWindows() or SextanteUtils.isMac():
return "io_gdal 0 -GRIDS \"" + destFilename + "\" -FILES \"" + layer+"\""
else:
return "libio_gdal 0 -GRIDS \"" + destFilename + "\" -FILES \"" + layer + "\""
@@ -33,9 +33,6 @@
from sextante.core.SextanteLog import SextanteLog
from qgis.core import *
from PyQt4.QtCore import *
from sextante.core.SextanteVectorWriter import SextanteVectorWriter
from sextante.core.QGisLayers import QGisLayers


class SagaUtils:

0 comments on commit 2bfffaa

Please sign in to comment.
You can’t perform that action at this time.