Skip to content
Permalink
Browse files

[processing] add test for OGR buffer with dissolve

  • Loading branch information
alexbruy committed Nov 12, 2016
1 parent 31a6189 commit 23de13c03f39e67e4451aa9a4bbeb087c995b0f4
@@ -0,0 +1,32 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>buffer_polys_dissolve</Name>
<ElementPath>buffer_polys_dissolve</ElementPath>
<!--MULTIPOLYGON-->
<GeometryType>6</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>1</FeatureCount>
<ExtentXMin>-1.50000</ExtentXMin>
<ExtentXMax>10.50000</ExtentXMax>
<ExtentYMin>-3.50000</ExtentYMin>
<ExtentYMax>6.50000</ExtentYMax>
</DatasetSpecificInfo>
<PropertyDefn>
<Name>name</Name>
<ElementPath>name</ElementPath>
<Type>String</Type>
<Width>4</Width>
</PropertyDefn>
<PropertyDefn>
<Name>intval</Name>
<ElementPath>intval</ElementPath>
<Type>Integer</Type>
</PropertyDefn>
<PropertyDefn>
<Name>floatval</Name>
<ElementPath>floatval</ElementPath>
<Type>Real</Type>
</PropertyDefn>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-1.5</gml:X><gml:Y>-3.5</gml:Y></gml:coord>
<gml:coord><gml:X>10.5</gml:X><gml:Y>6.5</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:buffer_polys_dissolve fid="polys.5">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.0,4.5 1.97383202187853,4.50068523262271 1.94773576836617,4.50273905231586 1.92178276747988,4.50615582970243 1.89604415459112,4.5109261996331 1.87059047744874,4.51703708685547 1.84549150281252,4.52447174185242 1.82081602522735,4.5332097867514 1.7966316784621,4.5432272711787 1.77300475013022,4.55449673790582 1.75,4.56698729810778 1.72768048249248,4.58066471602729 1.70610737385376,4.59549150281253 1.68533980447508,4.61142701927152 1.66543469682057,4.6284275872613 1.64644660940673,4.64644660940673 1.6284275872613,4.66543469682057 1.61142701927151,4.68533980447508 1.59549150281253,4.70610737385376 1.58066471602729,4.72768048249249 1.56698729810778,4.75 1.55449673790582,4.77300475013023 1.5432272711787,4.7966316784621 1.5332097867514,4.82081602522735 1.52447174185242,4.84549150281253 1.51703708685547,4.87059047744874 1.5109261996331,4.89604415459112 1.50615582970243,4.92178276747988 1.50273905231586,4.94773576836617 1.50068523262271,4.97383202187853 1.5,5.0 1.5,6.0 1.50068523262271,6.02616797812147 1.50273905231586,6.05226423163383 1.50615582970243,6.07821723252012 1.5109261996331,6.10395584540888 1.51703708685547,6.12940952255126 1.52447174185242,6.15450849718747 1.5332097867514,6.17918397477265 1.5432272711787,6.2033683215379 1.55449673790582,6.22699524986977 1.56698729810778,6.25 1.58066471602729,6.27231951750751 1.59549150281253,6.29389262614624 1.61142701927151,6.31466019552492 1.6284275872613,6.33456530317943 1.64644660940673,6.35355339059327 1.66543469682057,6.3715724127387 1.68533980447508,6.38857298072849 1.70610737385376,6.40450849718747 1.72768048249249,6.41933528397271 1.75,6.43301270189222 1.77300475013023,6.44550326209418 1.7966316784621,6.4567727288213 1.82081602522735,6.4667902132486 1.84549150281253,6.47552825814758 1.87059047744874,6.48296291314453 1.89604415459112,6.4890738003669 1.92178276747988,6.49384417029757 1.94773576836617,6.49726094768414 1.97383202187853,6.49931476737729 2.0,6.5 3.0,6.5 3.02616797812147,6.49931476737729 3.05226423163383,6.49726094768414 3.07821723252012,6.49384417029757 3.10395584540888,6.4890738003669 3.12940952255126,6.48296291314453 3.15450849718747,6.47552825814758 3.17918397477265,6.4667902132486 3.2033683215379,6.4567727288213 3.22699524986977,6.44550326209418 3.25,6.43301270189222 3.27231951750751,6.41933528397271 3.29389262614624,6.40450849718747 3.31466019552492,6.38857298072849 3.33456530317943,6.3715724127387 3.35355339059327,6.35355339059327 3.3715724127387,6.33456530317943 3.38857298072849,6.31466019552492 3.40450849718747,6.29389262614624 3.41933528397271,6.27231951750751 3.43301270189222,6.25 3.44550326209418,6.22699524986977 3.4567727288213,6.2033683215379 3.4667902132486,6.17918397477265 3.47552825814758,6.15450849718747 3.48296291314453,6.12940952255126 3.4890738003669,6.10395584540888 3.49384417029757,6.07821723252012 3.49726094768414,6.05226423163383 3.49931476737729,6.02616797812147 3.5,6.0 3.5,5.0 3.49931476737729,4.97383202187853 3.49726094768414,4.94773576836617 3.49384417029757,4.92178276747988 3.4890738003669,4.89604415459112 3.48296291314453,4.87059047744874 3.47552825814758,4.84549150281253 3.4667902132486,4.82081602522735 3.4567727288213,4.7966316784621 3.44550326209418,4.77300475013023 3.43301270189222,4.75 3.41933528397271,4.72768048249249 3.40450849718747,4.70610737385376 3.38857298072849,4.68533980447508 3.3715724127387,4.66543469682057 3.35355339059327,4.64644660940673 3.33456530317943,4.6284275872613 3.31466019552492,4.61142701927151 3.29389262614624,4.59549150281253 3.27231951750751,4.58066471602729 3.25,4.56698729810778 3.22699524986977,4.55449673790582 3.2033683215379,4.5432272711787 3.17918397477265,4.5332097867514 3.15450849718747,4.52447174185242 3.12940952255126,4.51703708685547 3.10395584540888,4.5109261996331 3.07821723252012,4.50615582970243 3.05226423163383,4.50273905231586 3.02616797812147,4.50068523262271 3.0,4.5 2.0,4.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.08113883008419,1.5 10.0,1.5 10.0261679781215,1.49931476737729 10.0522642316338,1.49726094768414 10.0782172325201,1.49384417029757 10.1039558454089,1.4890738003669 10.1294095225513,1.48296291314453 10.1545084971875,1.47552825814758 10.1791839747727,1.4667902132486 10.2033683215379,1.4567727288213 10.2269952498698,1.44550326209418 10.25,1.43301270189222 10.2723195175075,1.41933528397271 10.2938926261462,1.40450849718747 10.3146601955249,1.38857298072849 10.3345653031794,1.3715724127387 10.3535533905933,1.35355339059327 10.3715724127387,1.33456530317943 10.3885729807285,1.31466019552492 10.4045084971875,1.29389262614624 10.4193352839727,1.27231951750751 10.4330127018922,1.25 10.4455032620942,1.22699524986977 10.4567727288213,1.2033683215379 10.4667902132486,1.17918397477265 10.4755282581476,1.15450849718747 10.4829629131445,1.12940952255126 10.4890738003669,1.10395584540888 10.4938441702976,1.07821723252012 10.4972609476841,1.05226423163383 10.4993147673773,1.02616797812147 10.5,1.0 10.5,-3.0 10.4993147673773,-3.02616797812147 10.4972609476841,-3.05226423163383 10.4938441702976,-3.07821723252012 10.4890738003669,-3.10395584540888 10.4829629131445,-3.12940952255126 10.4755282581476,-3.15450849718747 10.4667902132486,-3.17918397477265 10.4567727288213,-3.2033683215379 10.4455032620942,-3.22699524986977 10.4330127018922,-3.25 10.4193352839727,-3.27231951750751 10.4045084971875,-3.29389262614624 10.3885729807285,-3.31466019552492 10.3715724127387,-3.33456530317943 10.3535533905933,-3.35355339059327 10.3345653031794,-3.3715724127387 10.3146601955249,-3.38857298072849 10.2938926261462,-3.40450849718747 10.2723195175075,-3.41933528397271 10.25,-3.43301270189222 10.2269952498698,-3.44550326209418 10.2033683215379,-3.4567727288213 10.1791839747727,-3.4667902132486 10.1545084971875,-3.47552825814758 10.1294095225513,-3.48296291314453 10.1039558454089,-3.4890738003669 10.0782172325201,-3.49384417029757 10.0522642316338,-3.49726094768414 10.0261679781215,-3.49931476737729 10.0,-3.5 6.0,-3.5 5.98861328689307,-3.49970182842365 5.97684539599473,-3.49946357656326 5.97533725589921,-3.4993541833173 5.97383202187853,-3.49931476737729 5.96251823694463,-3.49842435319234 5.95083407630899,-3.49757684024441 5.94928528203419,-3.49738289705456 5.94773576836617,-3.49726094768414 5.9365259930818,-3.49578515277056 5.92495651714532,-3.49433639930824 5.9233719137338,-3.49405338537093 5.92178276747988,-3.49384417029757 5.91070752419031,-3.49179149528389 5.89928312083856,-3.48975106967926 5.89766791313086,-3.48937474622386 5.89604415459112,-3.4890738003669 5.88513332451513,-3.48645434182173 5.87388373427931,-3.48383332617821 5.87224347033073,-3.48335976162441 5.87059047744874,-3.48296291314453 5.85987322117231,-3.47978831720649 5.84882745888886,-3.47659926858316 5.84716801174553,-3.47602486271796 5.84549150281252,-3.47552825814758 5.8349961834824,-3.47181167064814 5.82418246262228,-3.46806857782854 5.8225100105145,-3.46739008490037 5.82081602522735,-3.4667902132486 5.81057013464642,-3.46254622641139 5.80001579451109,-3.45826446246133 5.79833679952825,-3.45747901309239 5.7966316784621,-3.4567727288213 5.78666176627805,-3.45201732464636 5.77639320225002,-3.44721359549996 1.88196601125011,-1.5 -1.0,-1.5 -1.02616797812147,-1.49931476737729 -1.05226423163383,-1.49726094768414 -1.07821723252012,-1.49384417029757 -1.10395584540888,-1.4890738003669 -1.12940952255126,-1.48296291314453 -1.15450849718748,-1.47552825814758 -1.17918397477265,-1.4667902132486 -1.2033683215379,-1.4567727288213 -1.22699524986978,-1.44550326209418 -1.25,-1.43301270189222 -1.27231951750752,-1.41933528397271 -1.29389262614624,-1.40450849718747 -1.31466019552492,-1.38857298072848 -1.33456530317943,-1.3715724127387 -1.35355339059327,-1.35355339059327 -1.3715724127387,-1.33456530317943 -1.38857298072849,-1.31466019552492 -1.40450849718747,-1.29389262614624 -1.41933528397271,-1.27231951750751 -1.43301270189222,-1.25 -1.44550326209418,-1.22699524986977 -1.4567727288213,-1.2033683215379 -1.4667902132486,-1.17918397477265 -1.47552825814758,-1.15450849718747 -1.48296291314453,-1.12940952255126 -1.4890738003669,-1.10395584540888 -1.49384417029757,-1.07821723252012 -1.49726094768414,-1.05226423163383 -1.49931476737729,-1.02616797812147 -1.5,-1.0 -1.5,3.0 -1.49931476737729,3.02616797812147 -1.49726094768414,3.05226423163383 -1.49384417029757,3.07821723252012 -1.4890738003669,3.10395584540888 -1.48296291314453,3.12940952255126 -1.47552825814758,3.15450849718747 -1.4667902132486,3.17918397477265 -1.4567727288213,3.2033683215379 -1.44550326209418,3.22699524986977 -1.43301270189222,3.25 -1.41933528397271,3.27231951750751 -1.40450849718747,3.29389262614624 -1.38857298072849,3.31466019552492 -1.3715724127387,3.33456530317943 -1.35355339059327,3.35355339059327 -1.33456530317943,3.3715724127387 -1.31466019552492,3.38857298072849 -1.29389262614624,3.40450849718747 -1.27231951750751,3.41933528397271 -1.25,3.43301270189222 -1.22699524986977,3.44550326209418 -1.2033683215379,3.4567727288213 -1.17918397477265,3.4667902132486 -1.15450849718747,3.47552825814758 -1.12940952255126,3.48296291314453 -1.10395584540888,3.4890738003669 -1.07821723252012,3.49384417029757 -1.05226423163383,3.49726094768414 -1.02616797812147,3.49931476737729 -1.0,3.5 3.0,3.5 3.02616797812147,3.49931476737729 3.05226423163383,3.49726094768414 3.07821723252012,3.49384417029757 3.10395584540888,3.4890738003669 3.12940952255126,3.48296291314453 3.15450849718747,3.47552825814758 3.17918397477265,3.4667902132486 3.2033683215379,3.4567727288213 3.22699524986977,3.44550326209418 3.25,3.43301270189222 3.27231951750751,3.41933528397271 3.29389262614624,3.40450849718747 3.31466019552492,3.38857298072849 3.33456530317943,3.3715724127387 3.35355339059327,3.35355339059327 3.3715724127387,3.33456530317943 3.38857298072849,3.31466019552492 3.40450849718747,3.29389262614624 3.41933528397271,3.27231951750751 3.43301270189222,3.25 3.44550326209418,3.22699524986977 3.4567727288213,3.2033683215379 3.4667902132486,3.17918397477265 3.47552825814758,3.15450849718747 3.48296291314453,3.12940952255126 3.4890738003669,3.10395584540888 3.49384417029757,3.07821723252012 3.49726094768414,3.05226423163383 3.49931476737729,3.02616797812147 3.5,3.0 3.5,2.36037961002806 6.08113883008419,1.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs><gml:innerBoundaryIs><gml:LinearRing><gml:coordinates>7.5,-0.5 7.5,-1.5 8.5,-1.5 8.5,-0.5 7.5,-0.5</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.64644660940673,5.35355339059327 4.66543469682057,5.3715724127387 4.68533980447508,5.38857298072849 4.70610737385376,5.40450849718747 4.72768048249249,5.41933528397271 4.75,5.43301270189222 4.77300475013023,5.44550326209418 4.7966316784621,5.4567727288213 4.82081602522735,5.4667902132486 4.84549150281253,5.47552825814758 4.87059047744874,5.48296291314453 4.89604415459112,5.4890738003669 4.92178276747988,5.49384417029757 4.94773576836617,5.49726094768414 4.97383202187853,5.49931476737729 5.0,5.5 5.02616797812147,5.49931476737729 5.05226423163383,5.49726094768414 5.07821723252012,5.49384417029757 5.10395584540888,5.4890738003669 5.12940952255126,5.48296291314453 5.15450849718747,5.47552825814758 5.17918397477265,5.4667902132486 5.2033683215379,5.4567727288213 5.22699524986977,5.44550326209418 5.25,5.43301270189222 5.27231951750751,5.41933528397271 5.29389262614624,5.40450849718747 5.31466019552492,5.38857298072849 5.33456530317943,5.3715724127387 5.35355339059327,5.35355339059327 6.35355339059327,4.35355339059327 6.3715724127387,4.33456530317943 6.38857298072849,4.31466019552492 6.40450849718747,4.29389262614624 6.41933528397271,4.27231951750751 6.43301270189222,4.25 6.44550326209418,4.22699524986977 6.4567727288213,4.2033683215379 6.4667902132486,4.17918397477265 6.47552825814758,4.15450849718747 6.48296291314453,4.12940952255126 6.4890738003669,4.10395584540888 6.49384417029757,4.07821723252012 6.49726094768414,4.05226423163383 6.49931476737729,4.02616797812147 6.5,4.0 6.49931476737729,3.97383202187853 6.49726094768414,3.94773576836617 6.49384417029757,3.92178276747988 6.4890738003669,3.89604415459112 6.48296291314453,3.87059047744874 6.47552825814758,3.84549150281253 6.4667902132486,3.82081602522735 6.4567727288213,3.7966316784621 6.44550326209418,3.77300475013023 6.43301270189222,3.75 6.41933528397271,3.72768048249249 6.40450849718747,3.70610737385376 6.38857298072849,3.68533980447508 6.3715724127387,3.66543469682057 6.35355339059327,3.64644660940673 6.33456530317943,3.6284275872613 6.31466019552492,3.61142701927151 6.29389262614624,3.59549150281253 6.27231951750751,3.58066471602729 6.25,3.56698729810778 6.22699524986977,3.55449673790582 6.2033683215379,3.5432272711787 6.17918397477265,3.5332097867514 6.15450849718747,3.52447174185242 6.12940952255126,3.51703708685547 6.10395584540888,3.5109261996331 6.07821723252012,3.50615582970243 6.05226423163383,3.50273905231586 6.02616797812147,3.50068523262271 6.0,3.5 4.0,3.5 3.97383202187852,3.50068523262271 3.94773576836617,3.50273905231586 3.92178276747988,3.50615582970243 3.89604415459112,3.5109261996331 3.87059047744874,3.51703708685547 3.84549150281252,3.52447174185242 3.82081602522735,3.5332097867514 3.7966316784621,3.5432272711787 3.77300475013022,3.55449673790582 3.75,3.56698729810778 3.72768048249248,3.58066471602729 3.70610737385376,3.59549150281253 3.68533980447508,3.61142701927152 3.66543469682057,3.6284275872613 3.64644660940672,3.64644660940673 3.6284275872613,3.66543469682057 3.61142701927151,3.68533980447508 3.59549150281253,3.70610737385377 3.58066471602729,3.72768048249249 3.56698729810778,3.75 3.55449673790581,3.77300475013023 3.5432272711787,3.7966316784621 3.5332097867514,3.82081602522735 3.52447174185242,3.84549150281253 3.51703708685547,3.87059047744874 3.5109261996331,3.89604415459112 3.50615582970243,3.92178276747989 3.50273905231586,3.94773576836617 3.50068523262271,3.97383202187853 3.5,4.0 3.50068523262271,4.02616797812147 3.50273905231586,4.05226423163383 3.50615582970243,4.07821723252012 3.5109261996331,4.10395584540888 3.51703708685547,4.12940952255126 3.52447174185242,4.15450849718747 3.5332097867514,4.17918397477265 3.5432272711787,4.2033683215379 3.55449673790582,4.22699524986977 3.56698729810778,4.25 3.58066471602729,4.27231951750751 3.59549150281253,4.29389262614624 3.61142701927151,4.31466019552492 3.6284275872613,4.33456530317943 3.64644660940673,4.35355339059327 4.64644660940673,5.35355339059327</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:name>elim</ogr:name>
<ogr:intval>2</ogr:intval>
<ogr:floatval>3.330000000000000</ogr:floatval>
</ogr:buffer_polys_dissolve>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -86,6 +86,7 @@ tests:
OUTPUT_LAYER:
name: expected/gdal/buffer_lines.gml
type: vector

- algorithm: gdalogr:buffervectors
name: OGR basic polygon buffer
params:
@@ -100,3 +101,18 @@ tests:
OUTPUT_LAYER:
name: expected/gdal/buffer_polys.gml
type: vector

- algorithm: gdalogr:buffervectors
name: OGR polygon buffer with dissolve
params:
DISSOLVEALL: true
DISTANCE: '0.5'
GEOMETRY: geometry
INPUT_LAYER:
name: polys.gml
type: vector
MULTI: false
results:
OUTPUT_LAYER:
name: expected/gdal/buffer_polys_dissolve.gml
type: vector

0 comments on commit 23de13c

Please sign in to comment.
You can’t perform that action at this time.