Skip to content
Permalink
Browse files

[BUGFIX][Processing][Rscript] Use Extent Parameter

Add support for extent parameter to Rscript command.
  • Loading branch information
rldhont committed May 24, 2016
1 parent 47d0f5d commit 3244d4b2606a5e5c8054bc8a42116852ec995615
Showing with 8 additions and 2 deletions.
  1. +8 −2 python/plugins/processing/algs/r/RAlgorithm.py
@@ -320,7 +320,7 @@ def getImportCommands(self):
else:
commands.append(param.name + ' = ' + 'readGDAL("' + value
+ '")')
if isinstance(param, ParameterVector):
elif isinstance(param, ParameterVector):
value = param.getSafeExportedLayer()
value = value.replace('\\', '/')
filename = os.path.basename(value)
@@ -331,7 +331,7 @@ def getImportCommands(self):
else:
commands.append(param.name + ' = readOGR("' + folder
+ '",layer="' + filename + '")')
if isinstance(param, ParameterTable):
elif isinstance(param, ParameterTable):
value = param.value
if not value.lower().endswith('csv'):
raise GeoAlgorithmExecutionException(
@@ -341,6 +341,12 @@ def getImportCommands(self):
else:
commands.append(param.name + ' <- read.csv("' + value
+ '", head=TRUE, sep=",")')
elif isinstance(param, ParameterExtent):
if param.value:
tokens = unicode(param.value).split(',')
commands.append(param.name + ' = extent(' + tokens[0] + ',' + tokens[2] + ',' + tokens[1] + ',' + tokens[3] + ')')
else:
commands.append(param.name + ' = NULL')
elif isinstance(param, (ParameterTableField, ParameterString,
ParameterFile)):
commands.append(param.name + '="' + param.value + '"')

0 comments on commit 3244d4b

Please sign in to comment.
You can’t perform that action at this time.