Skip to content

Commit

Permalink
[processing] don't apply additional parameter if offset curve operati…
Browse files Browse the repository at this point in the history
…on is used (fix #15342)

(cherry picked from commit 1d2b0b4)
  • Loading branch information
alexbruy committed Aug 1, 2016
1 parent 3e43333 commit 6851c34
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions python/plugins/processing/algs/gdal/ogr2ogronesidebuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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 @@ -105,12 +105,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 @@ -119,14 +119,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 6851c34

Please sign in to comment.