Skip to content
Permalink
Browse files
Merge pull request #2110 from NaturalGIS/fix_grass7_v_voronoi
[processing] fix GRASS7 v.voronoi output as lines
  • Loading branch information
alexbruy committed Jun 8, 2015
2 parents 77d68b0 + fab465a commit 3ab1230bacb726b689281b7e28a81058afbd9e62
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 3ab1230

Please sign in to comment.