[BUGFIX][Processing][Rscript] Write output Table

Add support forwriting  output table to Rscript command.
This commit is contained in:
rldhont 2016-05-24 21:52:02 +02:00
parent 9928980851
commit 3b7c0fc04f

View File

@ -278,7 +278,7 @@ class RAlgorithm(GeoAlgorithm):
value = value + '.tif'
commands.append('writeGDAL(' + out.name + ',"' + value
+ '")')
if isinstance(out, OutputVector):
elif isinstance(out, OutputVector):
value = out.value
if not value.endswith('shp'):
value = value + '.shp'
@ -287,6 +287,10 @@ class RAlgorithm(GeoAlgorithm):
filename = filename[:-4]
commands.append('writeOGR(' + out.name + ',"' + value + '","'
+ filename + '", driver="ESRI Shapefile")')
elif isinstance(out, OutputTable):
value = out.value
value = value.replace('\\', '/')
commands.append('write.csv(' + out.name + ',"' + value + '"')
if self.showPlots:
commands.append('dev.off()')