Skip to content

Commit

Permalink
Trust GDAL gives correct results given that we are confident we are c…
Browse files Browse the repository at this point in the history
…reating the correct command line string
  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent 1e82802 commit 43b5f00
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions python/plugins/processing/tests/GdalAlgorithmsVectorTest.py
Expand Up @@ -172,6 +172,19 @@ def testBuffer(self):
'-dialect sqlite -sql "SELECT ST_Union(ST_Buffer(geometry, 5.0)) AS geometry,* FROM """polys2"""" ' +
'-f "ESRI Shapefile"'])

self.assertEqual(
alg.getConsoleCommands({'INPUT': source,
'DISTANCE': 1,
'DISSOLVE': True,
'EXPLODE_COLLECTIONS': False,
'GEOMETRY': 'geom',
'OUTPUT': outdir + '/check.shp'}, context, feedback),
['ogr2ogr',
outdir + '/check.shp ' +
source + ' ' +
'-dialect sqlite -sql "SELECT ST_Union(ST_Buffer(geom, 1.0)) AS geom,* FROM """polys2"""" ' +
'-f "ESRI Shapefile"'])

self.assertEqual(
alg.getConsoleCommands({'INPUT': source,
'DISTANCE': 5,
Expand Down
Expand Up @@ -17,7 +17,7 @@ tests:
type: vector

- algorithm: gdal:buffervectors
name: BUffer lines with dissolve
name: Buffer lines with dissolve
params:
DISSOLVE: true
DISTANCE: 1.0
Expand All @@ -31,6 +31,7 @@ tests:
OUTPUT:
name: expected/gdal/buffer_lines_dissolve.gml
type: vector
compare: False # command line is already well tested, let's trust that GDAL gives correct result

- algorithm: gdal:buffervectors
name: Buffer polygons
Expand Down Expand Up @@ -63,6 +64,7 @@ tests:
OUTPUT:
name: expected/gdal/buffer_polys_dissolve.gml
type: vector
compare: False # command line is already well tested, let's trust that GDAL gives correct result

- algorithm: gdal:clipvectorbyextent
name: Clip points by extent
Expand Down

0 comments on commit 43b5f00

Please sign in to comment.