Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
allow negative values for buffer distance in GDAL buffer algorithm (fix
  • Loading branch information
alexbruy authored and github-actions[bot] committed Jan 6, 2022
1 parent 5a3b771 commit e0cf563
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion python/plugins/processing/algs/gdal/Buffer.py
Expand Up @@ -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'),
Expand Down
10 changes: 10 additions & 0 deletions python/plugins/processing/tests/GdalAlgorithmsVectorTest.py
Expand Up @@ -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,
Expand Down

0 comments on commit e0cf563

Please sign in to comment.