Skip to content
Permalink
Browse files
Merge pull request #442 from MatMatt/master
[sextante]set package used when writing in case of #passfilenames
  • Loading branch information
volaya committed Mar 1, 2013
2 parents 54f3e0a + 735577d commit 1a1a925015ff81128b24b4de7cb99cb5a2b3c9e5
Showing 1 changed file with 7 additions and 6 deletions.
@@ -238,12 +238,12 @@ def getExportCommands(self):
for out in self.outputs:
if isinstance(out, OutputRaster):
value = out.value
if not value.endswith("tif"):
value = value + ".tif"
value = value.replace("\\", "/")
if self.useRraster:
if self.useRasterPackage or self.passFileNames:
commands.append("writeRaster(" + out.name + ",\"" + value + "\", overwrite=TRUE)")
else:
if not value.endswith("tif"):
value = value + ".tif"
commands.append("writeGDAL(" + out.name + ",\"" + value + "\")")
if isinstance(out, OutputVector):
value = out.value
@@ -273,12 +273,13 @@ def getImportCommands(self):
commands.append('deflibloc <- .libPaths()[1]')
commands.append('.libPaths(c("%s",deflibloc))' % rLibDir )
commands.append(
'tryCatch(find.package("rgdal"), error=function(e) install.packages("rgdal", lib="%s"))' % rLibDir)
'tryCatch(find.package("rgdal"), error=function(e) install.packages("rgdal", dependencies=TRUE, lib="%s"))' % rLibDir)
commands.append("library(\"rgdal\")");
if self.useRasterPackage:
if self.useRasterPackage or self.passFileNames:
commands.append(
'tryCatch(find.package("raster"), error=function(e) install.packages("raster", lib="%s"))' % rLibDir)
'tryCatch(find.package("raster"), error=function(e) install.packages("raster", dependencies=TRUE, lib="%s"))' % rLibDir)
commands.append("library(\"raster\")");

for param in self.parameters:
if isinstance(param, ParameterRaster):
value = param.value

0 comments on commit 1a1a925

Please sign in to comment.