@@ -242,7 +242,7 @@ def getExportCommands(self):
242
242
value = value + ".tif"
243
243
value = value .replace ("\\ " , "/" )
244
244
if self .useRraster :
245
- commands .append ("writeRaster(" + out .name + ",\" " + value + "\" , datatype=dataType(" + out . name + "), overwrite=TRUE)" )
245
+ commands .append ("writeRaster(" + out .name + ",\" " + value + "\" , overwrite=TRUE)" )
246
246
else :
247
247
commands .append ("writeGDAL(" + out .name + ",\" " + value + "\" )" )
248
248
if isinstance (out , OutputVector ):
@@ -282,7 +282,7 @@ def getImportCommands(self):
282
282
value = param .value
283
283
value = value .replace ("\\ " , "/" )
284
284
if self .passFileNames :
285
- commands .append (param .name + " = " + value )
285
+ commands .append (param .name + " = \" " + value + " \" " )
286
286
elif self .useRasterPackage :
287
287
commands .append (param .name + " = " + "brick(\" " + value + "\" )" )
288
288
else :
@@ -294,15 +294,15 @@ def getImportCommands(self):
294
294
filename = filename [:- 4 ]
295
295
folder = os .path .dirname (value )
296
296
if self .passFileNames :
297
- commands .append (param .name + " = " + value )
297
+ commands .append (param .name + " = \" " + value + " \" " )
298
298
else :
299
299
commands .append (param .name + " = readOGR(\" " + folder + "\" ,layer=\" " + filename + "\" )" )
300
300
if isinstance (param , ParameterTable ):
301
301
value = param .value
302
302
if not value .lower ().endswith ("csv" ):
303
303
raise GeoAlgorithmExecutionException ("Unsupported input file format.\n " + value )
304
304
if self .passFileNames :
305
- commands .append (param .name + " = " + value )
305
+ commands .append (param .name + " = \" " + value + " \" " )
306
306
else :
307
307
commands .append (param .name + " <- read.csv(\" " + value + "\" , head=TRUE, sep=\" ,\" )" )
308
308
elif isinstance (param , (ParameterTableField , ParameterString , ParameterFile )):
@@ -323,11 +323,11 @@ def getImportCommands(self):
323
323
#raise GeoAlgorithmExecutionException("Unsupported input file format.\n" + layer)
324
324
layer = layer .replace ("\\ " , "/" )
325
325
if self .passFileNames :
326
- commands .append ("tempvar" + str (iLayer )+ " = \" " + layer + "\" " )
326
+ commands .append ("tempvar" + str (iLayer )+ " <- \" " + layer + "\" " )
327
327
elif self .useRasterPackage :
328
- commands .append ("tempvar" + str (iLayer )+ " = " + "brick(\" " + layer + "\" )" )
328
+ commands .append ("tempvar" + str (iLayer )+ " <- " + "brick(\" " + layer + "\" )" )
329
329
else :
330
- commands .append ("tempvar" + str (iLayer )+ " = " + "readGDAL(\" " + layer + "\" )" )
330
+ commands .append ("tempvar" + str (iLayer )+ " <- " + "readGDAL(\" " + layer + "\" )" )
331
331
iLayer += 1
332
332
else :
333
333
exported = param .getSafeExportedLayers ()
@@ -339,9 +339,9 @@ def getImportCommands(self):
339
339
filename = os .path .basename (layer )
340
340
filename = filename [:- 4 ]
341
341
if self .passFileNames :
342
- commands .append ("tempvar" + str (iLayer )+ " = \" " + layer + "\" " )
342
+ commands .append ("tempvar" + str (iLayer )+ " <- \" " + layer + "\" " )
343
343
else :
344
- commands .append ("tempvar" + str (iLayer ) + " = " + "readOGR(\" " + layer + "\" ,layer=\" " + filename + "\" )" )
344
+ commands .append ("tempvar" + str (iLayer ) + " <- " + "readOGR(\" " + layer + "\" ,layer=\" " + filename + "\" )" )
345
345
iLayer += 1
346
346
s = ""
347
347
s += param .name
0 commit comments