Skip to content
Permalink
Browse files
fix GRASS7 v.voronoi output as lines
  • Loading branch information
Giovanni Manghi committed Jun 4, 2015
1 parent 9d38b71 commit fab465aa16b8af50c839b39185c094151c386e09
Showing with 15 additions and 19 deletions.
  1. +15 −19 python/plugins/processing/algs/grass7/Grass7Algorithm.py
@@ -401,30 +401,26 @@ 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.
typeidx = \
self.getParameterValue(self.GRASS_OUTPUT_TYPE_PARAMETER)
outtype = ('auto' if typeidx
is None else self.OUTPUT_TYPES[typeidx])
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)
elif self.grass7Name == 'v.voronoi':
if '-l' in command:
command = 'v.out.ogr type=line layer=0 -c -e input=' + out.name + uniqueSufix
else :
command = 'v.out.ogr -s -e input=' + out.name + uniqueSufix
command += ' type=' + outtype
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)
command += ' output="' + os.path.dirname(out.value) + '"'
command += ' format=ESRI_Shapefile'
command += ' olayer=' + os.path.basename(out.value)[:-4]
commands.append(command)
outputCommands.append(command)

# 4: Run GRASS

0 comments on commit fab465a

Please sign in to comment.