Skip to content
Permalink
Browse files
allow negative values for buffer distance in GDAL buffer algorithm (fix
  • Loading branch information
alexbruy authored and github-actions committed Jan 6, 2022
1 parent 33a62ca commit c70a84cf428ad7c6f094ef0da88d0b242793c656
Showing with 10 additions and 1 deletion.
  1. +0 −1 python/plugins/processing/algs/gdal/Buffer.py
  2. +10 −0 python/plugins/processing/tests/GdalAlgorithmsVectorTest.py
@@ -57,7 +57,6 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterDistance(self.DISTANCE,
self.tr('Buffer distance'),
parentParameterName=self.INPUT,
minValue=0.0,
defaultValue=10.0))
self.addParameter(QgsProcessingParameterField(self.FIELD,
self.tr('Dissolve by attribute'),
@@ -161,6 +161,16 @@ def testBuffer(self):
'-dialect sqlite -sql "SELECT ST_Buffer(geometry, 5.0) AS geometry,* FROM \\"polys2\\"" ' +
'-f "ESRI Shapefile"'])

self.assertEqual(
alg.getConsoleCommands({'INPUT': source,
'DISTANCE': -5,
'OUTPUT': outdir + '/check.shp'}, context, feedback),
['ogr2ogr',
outdir + '/check.shp ' +
source + ' ' +
'-dialect sqlite -sql "SELECT ST_Buffer(geometry, -5.0) AS geometry,* FROM """polys2"""" ' +
'-f "ESRI Shapefile"'])

self.assertEqual(
alg.getConsoleCommands({'INPUT': source,
'DISTANCE': 5,

0 comments on commit c70a84c

Please sign in to comment.