Skip to content

Commit 98dfda3

Browse files
committed
[processing] restore buffer algorithm
1 parent bba509e commit 98dfda3

File tree

3 files changed

+58
-195
lines changed

3 files changed

+58
-195
lines changed

python/plugins/processing/algs/gdal/GdalAlgorithmProvider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
# from .gdalcalc import gdalcalc
7474
# from .rasterize_over import rasterize_over
7575

76+
from .Buffer import Buffer
7677
from .OffsetCurve import OffsetCurve
7778
from .ogrinfo import ogrinfo
7879
from .OgrToPostGis import OgrToPostGis
@@ -82,7 +83,6 @@
8283
# from .ogr2ogrclip import Ogr2OgrClip
8384
# from .ogr2ogrclipextent import Ogr2OgrClipExtent
8485
# from .ogr2ogrtopostgislist import Ogr2OgrToPostGisList
85-
# from .ogr2ogrbuffer import Ogr2OgrBuffer
8686
# from .ogr2ogrdissolve import Ogr2OgrDissolve
8787
# from .onesidebuffer import OneSideBuffer
8888
# from .ogr2ogrtabletopostgislist import Ogr2OgrTableToPostGisList
@@ -175,6 +175,7 @@ def loadAlgorithms(self):
175175
# gdalcalc(),
176176
# rasterize_over(),
177177
# ----- OGR tools -----
178+
Buffer(),
178179
OffsetCurve(),
179180
ogrinfo(),
180181
OgrToPostGis(),
@@ -183,7 +184,6 @@ def loadAlgorithms(self):
183184
# Ogr2OgrClip(),
184185
# Ogr2OgrClipExtent(),
185186
# Ogr2OgrToPostGisList(),
186-
# Ogr2OgrBuffer(),
187187
# Ogr2OgrDissolve(),
188188
# OneSideBuffer(),
189189
# Ogr2OgrTableToPostGisList(),

python/plugins/processing/algs/gdal/ogr2ogrbuffer.py

Lines changed: 0 additions & 137 deletions
This file was deleted.

python/plugins/processing/tests/testdata/gdal_algorithm_tests.yaml

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,62 @@ tests:
489489
geometry:
490490
precision: 7
491491

492+
- algorithm: gdal:buffervectors
493+
name: Buffer lines
494+
params:
495+
DISSOLVEALL: false
496+
DISTANCE: 1.0
497+
GEOMETRY: geometry
498+
INPUT_LAYER:
499+
name: lines.gml
500+
type: vector
501+
MULTI: false
502+
results:
503+
OUTPUT_LAYER:
504+
name: expected/gdal/buffer_lines.gml
505+
type: vector
506+
compare:
507+
geometry:
508+
precision: 7
509+
expectedFailure:
510+
- int(1)
511+
512+
- algorithm: gdal:buffervectors
513+
name: Basic polygon buffer
514+
params:
515+
DISSOLVEALL: false
516+
DISTANCE: 0.5
517+
GEOMETRY: geometry
518+
INPUT_LAYER:
519+
name: polys.gml
520+
type: vector
521+
MULTI: false
522+
results:
523+
OUTPUT_LAYER:
524+
name: expected/gdal/buffer_polys.gml
525+
type: vector
526+
compare:
527+
geometry:
528+
precision: 7
529+
530+
- algorithm: gdal:buffervectors
531+
name: Polygon buffer with dissolve
532+
params:
533+
DISSOLVEALL: true
534+
DISTANCE: 0.5
535+
GEOMETRY: geometry
536+
INPUT_LAYER:
537+
name: polys.gml
538+
type: vector
539+
MULTI: false
540+
results:
541+
OUTPUT_LAYER:
542+
name: expected/gdal/buffer_polys_dissolve.gml
543+
type: vector
544+
compare:
545+
geometry:
546+
precision: 7
547+
492548
# - algorithm: gdal:singlesidedbufferforlines
493549
# name: One-side buffer for lines (left-handed)
494550
# params:
@@ -508,59 +564,3 @@ tests:
508564
# geometry:
509565
# precision: 7
510566
#
511-
# - algorithm: gdal:buffervectors
512-
# name: Buffer lines
513-
# params:
514-
# DISSOLVEALL: false
515-
# DISTANCE: 1.0
516-
# GEOMETRY: geometry
517-
# INPUT_LAYER:
518-
# name: lines.gml
519-
# type: vector
520-
# MULTI: false
521-
# results:
522-
# OUTPUT_LAYER:
523-
# name: expected/gdal/buffer_lines.gml
524-
# type: vector
525-
# compare:
526-
# geometry:
527-
# precision: 7
528-
# expectedFailure:
529-
# - int(1)
530-
#
531-
# - algorithm: gdal:buffervectors
532-
# name: Basic polygon buffer
533-
# params:
534-
# DISSOLVEALL: false
535-
# DISTANCE: 0.5
536-
# GEOMETRY: geometry
537-
# INPUT_LAYER:
538-
# name: polys.gml
539-
# type: vector
540-
# MULTI: false
541-
# results:
542-
# OUTPUT_LAYER:
543-
# name: expected/gdal/buffer_polys.gml
544-
# type: vector
545-
# compare:
546-
# geometry:
547-
# precision: 7
548-
#
549-
# - algorithm: gdal:buffervectors
550-
# name: Polygon buffer with dissolve
551-
# params:
552-
# DISSOLVEALL: true
553-
# DISTANCE: 0.5
554-
# GEOMETRY: geometry
555-
# INPUT_LAYER:
556-
# name: polys.gml
557-
# type: vector
558-
# MULTI: false
559-
# results:
560-
# OUTPUT_LAYER:
561-
# name: expected/gdal/buffer_polys_dissolve.gml
562-
# type: vector
563-
# compare:
564-
# geometry:
565-
# precision: 7
566-
#

0 commit comments

Comments
 (0)