Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] don't apply additional parameter if offset curve operati…
…on is used (fix #15342)
  • Loading branch information
alexbruy committed Aug 1, 2016
1 parent 98a5527 commit 1d2b0b4
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py
Expand Up @@ -85,7 +85,7 @@ def getConsoleCommands(self):
inLayer = self.getParameterValue(self.INPUT_LAYER)
ogrLayer = ogrConnectionString(inLayer)[1:-1]
layername = "'" + ogrLayerName(inLayer) + "'"
operation = self.OPERATIONLIST[self.getParameterValue(self.OPERATION)]
operation = self.getParameterValue(self.OPERATION)
geometry = unicode(self.getParameterValue(self.GEOMETRY))
distance = unicode(self.getParameterValue(self.RADIUS))
leftright = self.LEFTRIGHTLIST[self.getParameterValue(self.LEFTRIGHT)]
Expand All @@ -104,12 +104,12 @@ def getConsoleCommands(self):
arguments.append(ogrLayer)
arguments.append(ogrLayerName(inLayer))
if dissolveall or field != 'None':
if operation == 'Single Side Buffer':
if operation == 0:
arguments.append('-dialect sqlite -sql "SELECT ST_Union(ST_SingleSidedBuffer(')
else:
arguments.append('-dialect sqlite -sql "SELECT ST_Union(ST_OffsetCurve(')
else:
if operation == 'Single Side Buffer':
if operation == 0:
arguments.append('-dialect sqlite -sql "SELECT ST_SingleSidedBuffer(')
else:
arguments.append('-dialect sqlite -sql "SELECT ST_OffsetCurve(')
Expand All @@ -118,14 +118,26 @@ def getConsoleCommands(self):
arguments.append(distance)
if dissolveall or field != 'None':
if leftright == 'Left':
arguments.append(',0)),*')
if operation == 0:
arguments.append(',0)),*')
else:
arguments.append(')),*')
else:
arguments.append(',1)),*')
if operation == 0:
arguments.append(',1)),*')
else:
arguments.append(')),*')
else:
if leftright == 'Left':
arguments.append(',0),*')
if operation == 0:
arguments.append(',0),*')
else:
arguments.append('),*')
else:
arguments.append(',1),*')
if operation == 0:
arguments.append(',1),*')
else:
arguments.append('),*')
arguments.append('FROM')
arguments.append(layername)
if field != 'None':
Expand Down

0 comments on commit 1d2b0b4

Please sign in to comment.