Skip to content
Permalink
Browse files
now passFileNames uses raster in case of writing.
raster:::writeRaster supports any gdal formats (passFileNames and useRasterPackage)
and some other changes
  • Loading branch information
MatMatt committed Feb 26, 2013
1 parent 037f601 commit 735577d32f9af113a4d61ae2479c79d6f9e0433a
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 735577d

Please sign in to comment.