Skip to content

Commit

Permalink
fix GRASS7 r.flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni Manghi committed May 24, 2015
1 parent 2ff6f72 commit b1baa6e
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 16 deletions.
35 changes: 24 additions & 11 deletions python/plugins/processing/algs/grass7/Grass7Algorithm.py
Expand Up @@ -384,17 +384,30 @@ def processAlgorithm(self, progress):
if isinstance(out, OutputVector):
filename = out.value
# FIXME: check if needed: -c Also export features without category (not labeled). Otherwise only features with category are exported.
command = 'v.out.ogr -s -e input=' + out.name + uniqueSufix
command += ' output="' + os.path.dirname(out.value) + '"'
command += ' format=ESRI_Shapefile'
command += ' olayer=' + os.path.basename(out.value)[:-4]
typeidx = \
self.getParameterValue(self.GRASS_OUTPUT_TYPE_PARAMETER)
outtype = ('auto' if typeidx
is None else self.OUTPUT_TYPES[typeidx])
command += ' type=' + outtype
commands.append(command)
outputCommands.append(command)
if self.grass7Name == 'r.flow':
command = 'v.out.ogr type=line layer=0 -c -e input=' + out.name + uniqueSufix
command += ' output="' + os.path.dirname(out.value) + '"'
command += ' format=ESRI_Shapefile'
command += ' olayer=' + os.path.basename(out.value)[:-4]
typeidx = \
self.getParameterValue(self.GRASS_OUTPUT_TYPE_PARAMETER)
outtype = ('auto' if typeidx
is None else self.OUTPUT_TYPES[typeidx])
command += ' type=' + outtype
commands.append(command)
outputCommands.append(command)
else:
command = 'v.out.ogr -s -e input=' + out.name + uniqueSufix
command += ' output="' + os.path.dirname(out.value) + '"'
command += ' format=ESRI_Shapefile'
command += ' olayer=' + os.path.basename(out.value)[:-4]
typeidx = \
self.getParameterValue(self.GRASS_OUTPUT_TYPE_PARAMETER)
outtype = ('auto' if typeidx
is None else self.OUTPUT_TYPES[typeidx])
command += ' type=' + outtype
commands.append(command)
outputCommands.append(command)

# 4: Run GRASS

Expand Down
@@ -0,0 +1,14 @@
r.flow
r.flow.aspect.barrier - Construction of flowlines, flowpath lengths, and flowaccumulation (contributing areas) from a raster digital elevation model (DEM).
Raster (r.*)
ParameterRaster|elevation|Elevation|False
ParameterRaster|aspect|Aspect|False
ParameterRaster|barrier|Barriers|False
ParameterNumber|skip|Number of cells between flowlines|None|None|7
ParameterNumber|bound|Maximum number of segments per flowline|None|None|1609
ParameterBoolean|-u|Compute upslope flowlines instead of default downhill flowlines|False
ParameterBoolean|-3|3-D lengths instead of 2-D|False
*ParameterBoolean|-m|Use less memory, at a performance penalty|False
OutputVector|flowline|Flow line
OutputRaster|flowlength|Flow path length
OutputRaster|flowaccumulation|Flow accumulation
@@ -0,0 +1,13 @@
r.flow
r.flow.aspect - Construction of flowlines, flowpath lengths, and flowaccumulation (contributing areas) from a raster digital elevation model (DEM).
Raster (r.*)
ParameterRaster|elevation|Elevation|False
ParameterRaster|aspect|Aspect|False
ParameterNumber|skip|Number of cells between flowlines|None|None|7
ParameterNumber|bound|Maximum number of segments per flowline|None|None|1609
ParameterBoolean|-u|Compute upslope flowlines instead of default downhill flowlines|False
ParameterBoolean|-3|3-D lengths instead of 2-D|False
*ParameterBoolean|-m|Use less memory, at a performance penalty|False
OutputVector|flowline|Flow line
OutputRaster|flowlength|Flow path length
OutputRaster|flowaccumulation|Flow accumulation
@@ -0,0 +1,13 @@
r.flow
r.flow.barrier - Construction of flowlines, flowpath lengths, and flowaccumulation (contributing areas) from a raster digital elevation model (DEM).
Raster (r.*)
ParameterRaster|elevation|Elevation|False
ParameterRaster|barrier|Barriers|False
ParameterNumber|skip|Number of cells between flowlines|None|None|7
ParameterNumber|bound|Maximum number of segments per flowline|None|None|1609
ParameterBoolean|-u|Compute upslope flowlines instead of default downhill flowlines|False
ParameterBoolean|-3|3-D lengths instead of 2-D|False
*ParameterBoolean|-m|Use less memory, at a performance penalty|False
OutputVector|flowline|Flow line
OutputRaster|flowlength|Flow path length
OutputRaster|flowaccumulation|Flow accumulation
8 changes: 3 additions & 5 deletions python/plugins/processing/algs/grass7/description/r.flow.txt
Expand Up @@ -2,13 +2,11 @@ r.flow
r.flow - Construction of flowlines, flowpath lengths, and flowaccumulation (contributing areas) from a raster digital elevation model (DEM).
Raster (r.*)
ParameterRaster|elevation|Elevation|False
ParameterRaster|aspect|Aspect|False
ParameterRaster|barrier|Barriers|False
ParameterNumber|skip|Number of cells between flowlines|None|None|1.0
ParameterNumber|bound|Maximum number of segments per flowline|None|None|5.0
ParameterNumber|skip|Number of cells between flowlines|None|None|7
ParameterNumber|bound|Maximum number of segments per flowline|None|None|1609
ParameterBoolean|-u|Compute upslope flowlines instead of default downhill flowlines|False
ParameterBoolean|-3|3-D lengths instead of 2-D|False
*ParameterBoolean|-m|Use less memory, at a performance penalty|False
OutputRaster|flowline|Flow line
OutputVector|flowline|Flow line
OutputRaster|flowlength|Flow path length
OutputRaster|flowaccumulation|Flow accumulation

0 comments on commit b1baa6e

Please sign in to comment.