@@ -238,12 +238,12 @@ def getExportCommands(self):
238
238
for out in self .outputs :
239
239
if isinstance (out , OutputRaster ):
240
240
value = out .value
241
- if not value .endswith ("tif" ):
242
- value = value + ".tif"
243
241
value = value .replace ("\\ " , "/" )
244
- if self .useRraster :
242
+ if self .useRasterPackage or self . passFileNames :
245
243
commands .append ("writeRaster(" + out .name + ",\" " + value + "\" , overwrite=TRUE)" )
246
244
else :
245
+ if not value .endswith ("tif" ):
246
+ value = value + ".tif"
247
247
commands .append ("writeGDAL(" + out .name + ",\" " + value + "\" )" )
248
248
if isinstance (out , OutputVector ):
249
249
value = out .value
@@ -273,12 +273,13 @@ def getImportCommands(self):
273
273
commands .append ('deflibloc <- .libPaths()[1]' )
274
274
commands .append ('.libPaths(c("%s",deflibloc))' % rLibDir )
275
275
commands .append (
276
- 'tryCatch(find.package("rgdal"), error=function(e) install.packages("rgdal", lib="%s"))' % rLibDir )
276
+ 'tryCatch(find.package("rgdal"), error=function(e) install.packages("rgdal", dependencies=TRUE, lib="%s"))' % rLibDir )
277
277
commands .append ("library(\" rgdal\" )" );
278
- if self .useRasterPackage :
278
+ if self .useRasterPackage or self . passFileNames :
279
279
commands .append (
280
- 'tryCatch(find.package("raster"), error=function(e) install.packages("raster", lib="%s"))' % rLibDir )
280
+ 'tryCatch(find.package("raster"), error=function(e) install.packages("raster", dependencies=TRUE , lib="%s"))' % rLibDir )
281
281
commands .append ("library(\" raster\" )" );
282
+
282
283
for param in self .parameters :
283
284
if isinstance (param , ParameterRaster ):
284
285
value = param .value
0 commit comments