Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix GRASS7 v.voronoi output as lines
  • Loading branch information
Giovanni Manghi committed Jun 4, 2015
1 parent 9d38b71 commit fab465a
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions python/plugins/processing/algs/grass7/Grass7Algorithm.py
Expand Up @@ -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

Expand Down

0 comments on commit fab465a

Please sign in to comment.