Skip to content
Permalink
Browse files
Merge pull request #46720 from qgis/backport-46717-to-release-3_22
[Backport release-3_22] allow negative values for buffer distance in GDAL buffer algorithm (fix #46667)
  • Loading branch information
alexbruy committed Jan 6, 2022
2 parents 5a3b771 + e0cf563 commit a254dee87bafdb862c3444095ab68cd608115831
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 a254dee

Please sign in to comment.