Skip to content

Commit

Permalink
Merge pull request #3097 from rldhont/bugfix_processing_rscript_extent
Browse files Browse the repository at this point in the history
[processing] add missed extent parameter to R provider
  • Loading branch information
alexbruy committed May 24, 2016
2 parents 2bba191 + 5d7e218 commit 9928980
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/plugins/processing/algs/r/RAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,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)
Expand All @@ -334,7 +334,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(
Expand All @@ -344,6 +344,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 + '"')
Expand Down

0 comments on commit 9928980

Please sign in to comment.