Skip to content
Permalink
Browse files

[processing] test for OGR one-side buffer

  • Loading branch information
alexbruy committed Nov 12, 2016
1 parent 32094e9 commit d239a97c4133a508da6bf483627f7cdb380feafa
@@ -0,0 +1,16 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>one_side_buffer</Name>
<ElementPath>one_side_buffer</ElementPath>
<!--POLYGON-->
<GeometryType>3</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>7</FeatureCount>
<ExtentXMin>-1.00000</ExtentXMin>
<ExtentXMax>11.00000</ExtentXMax>
<ExtentYMin>-3.00000</ExtentYMin>
<ExtentYMax>5.35355</ExtentYMax>
</DatasetSpecificInfo>
</GMLFeatureClass>
</GMLFeatureClassList>
@@ -0,0 +1,48 @@
<?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</gml:X><gml:Y>-3</gml:Y></gml:coord>
<gml:coord><gml:X>11</gml:X><gml:Y>5.353553390593274</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:one_side_buffer fid="lines.0">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>11,5 9,3 9,2 6,2 6.0,2.5 8.5,2.5 8.5,3.0 8.5024076366639,3.04900857016478 8.50960735979838,3.09754516100806 8.5215298321339,3.14514233862723 8.53806023374436,3.19134171618255 8.55903936782582,3.235698368413 8.58426519384873,3.2777851165098 8.61349477331863,3.31719664208182 8.64644660940673,3.35355339059327 10.6464466094067,5.35355339059327 11,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
</ogr:one_side_buffer>
</gml:featureMember>
<gml:featureMember>
<ogr:one_side_buffer fid="lines.1">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,-1 -1,-1 -1.0,-0.5 1.0,-0.5 1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
</ogr:one_side_buffer>
</gml:featureMember>
<gml:featureMember>
<ogr:one_side_buffer fid="lines.2">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,3 3,2 2,2 2,0 1.5,0.0 1.5,2.0 1.5024076366639,2.04900857016478 1.50960735979838,2.09754516100806 1.5215298321339,2.14514233862723 1.53806023374436,2.19134171618254 1.55903936782582,2.235698368413 1.58426519384873,2.2777851165098 1.61349477331863,2.31719664208182 1.64644660940673,2.35355339059327 1.68280335791818,2.38650522668137 1.7222148834902,2.41573480615127 1.764301631587,2.44096063217418 1.80865828381746,2.46193976625564 1.85485766137277,2.4784701678661 1.90245483899194,2.49039264020162 1.95099142983522,2.4975923633361 2.0,2.5 2.5,2.5 2.5,3.0 3,3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
</ogr:one_side_buffer>
</gml:featureMember>
<gml:featureMember>
<ogr:one_side_buffer fid="lines.3">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,1 3,1 3.0,1.5 5.0,1.5 5,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
</ogr:one_side_buffer>
</gml:featureMember>
<gml:featureMember>
<ogr:one_side_buffer fid="lines.4">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>10,-3 7,-3 7.0,-2.5 10.0,-2.5 10,-3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
</ogr:one_side_buffer>
</gml:featureMember>
<gml:featureMember>
<ogr:one_side_buffer fid="lines.5">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>10,1 6,-3 5.64644660940673,-2.64644660940673 9.64644660940673,1.35355339059327 10,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
</ogr:one_side_buffer>
</gml:featureMember>
<gml:featureMember>
<ogr:one_side_buffer fid="lines.6">
</ogr:one_side_buffer>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -143,3 +143,19 @@ tests:
OUTPUT_LAYER:
name: expected/gdal/offset_lines.gml
type: vector

- algorithm: gdalogr:singlesidedbufferforlines
name: OGR one-side buffer for lines (left-handed)
params:
DISSOLVEALL: false
GEOMETRY: geometry
INPUT_LAYER:
name: lines.gml
type: vector
LEFTRIGHT: '1'
MULTI: false
RADIUS: 0.5
results:
OUTPUT_LAYER:
name: expected/gdal/one_side_buffer.gml
type: vector

0 comments on commit d239a97

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