@@ -323,7 +323,7 @@ def getImportCommands(self):
323
323
else :
324
324
commands .append (param .name + ' = ' + 'readGDAL("' + value
325
325
+ '")' )
326
- if isinstance (param , ParameterVector ):
326
+ elif isinstance (param , ParameterVector ):
327
327
value = param .getSafeExportedLayer ()
328
328
value = value .replace ('\\ ' , '/' )
329
329
filename = os .path .basename (value )
@@ -334,7 +334,7 @@ def getImportCommands(self):
334
334
else :
335
335
commands .append (param .name + ' = readOGR("' + folder
336
336
+ '",layer="' + filename + '")' )
337
- if isinstance (param , ParameterTable ):
337
+ elif isinstance (param , ParameterTable ):
338
338
value = param .value
339
339
if not value .lower ().endswith ('csv' ):
340
340
raise GeoAlgorithmExecutionException (
@@ -344,6 +344,12 @@ def getImportCommands(self):
344
344
else :
345
345
commands .append (param .name + ' <- read.csv("' + value
346
346
+ '", head=TRUE, sep=",")' )
347
+ elif isinstance (param , ParameterExtent ):
348
+ if param .value :
349
+ tokens = unicode (param .value ).split (',' )
350
+ commands .append (param .name + ' = extent(' + tokens [0 ] + ',' + tokens [2 ] + ',' + tokens [1 ] + ',' + tokens [3 ] + ')' )
351
+ else :
352
+ commands .append (param .name + ' = NULL' )
347
353
elif isinstance (param , (ParameterTableField , ParameterString ,
348
354
ParameterFile )):
349
355
commands .append (param .name + '="' + param .value + '"' )
0 commit comments