Skip to content

Commit

Permalink
Add secondary reference layer for tapered buffer alg
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 5, 2021
1 parent af03d11 commit da76d9e
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ tapered_buffer_multilinev2.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-1.2</gml:X><gml:Y>-1.4</gml:Y></gml:coord>
<gml:coord><gml:X>5.980422264875241</gml:X><gml:Y>4.519769673704415</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:tapered_buffer_multilinev2 fid="lines.1">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1.2 -1.1,-1.17320508075689 -1.17320508075689,-1.1 -1.2,-1 -1.17320508075689,-0.9 -1.1,-0.826794919243112 -1,-0.8 1.0,-0.6 1.2,-0.653589838486225 1.34641016151378,-0.8 1.4,-1 1.34641016151378,-1.2 1.2,-1.34641016151378 1.0,-1.4 -1,-1.2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:tapered_buffer_multilinev2>
</gml:featureMember>
<gml:featureMember>
<ogr:tapered_buffer_multilinev2 fid="lines.2">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3.0,0.8 2.9,0.826794919243112 2.82679491924311,0.9 2.8,1.0 2.82679491924311,1.1 2.9,1.17320508075689 3.0,1.2 5.0,1.4 5.2,1.34641016151378 5.34641016151378,1.2 5.4,1.0 5.34641016151378,0.8 5.2,0.653589838486225 5.0,0.6 3.0,0.8</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.4,1.0 5.34641016151378,0.8 5.2,0.653589838486225 5.0,0.6 4.8,0.653589838486224 4.65358983848622,0.8 4.6,1.0 4.82418426103647,2.4147792706334 4.85097918027958,2.5147792706334 4.92418426103647,2.58798435139029 5.02418426103647,2.6147792706334 5.12418426103647,2.58798435139029 5.19738934179336,2.5147792706334 5.22418426103647,2.4147792706334 5.4,1.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:tapered_buffer_multilinev2>
</gml:featureMember>
<gml:featureMember>
<ogr:tapered_buffer_multilinev2 fid="lines.3">
</ogr:tapered_buffer_multilinev2>
</gml:featureMember>
<gml:featureMember>
<ogr:tapered_buffer_multilinev2 fid="lines.4">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.2,-0.0 2.17320508075689,-0.1 2.1,-0.173205080756888 2.0,-0.2 1.9,-0.173205080756888 1.82679491924311,-0.1 1.8,0.0 1.7,2.0 1.74019237886467,2.15 1.85,2.25980762113533 2.0,2.3 2.63341645885287,2.33167082294264 2.6,3.0 2.65358983848622,3.2 2.8,3.34641016151378 3.0,3.4 3.2,3.34641016151378 3.34641016151378,3.2 3.4,3.0 3.35,2.0 3.30310889132455,1.825 3.175,1.69689110867545 3.0,1.65 2.28428927680798,1.6857855361596 2.2,-0.0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.94433781190019,3.84721689059501 2.84433781190019,3.87401180983812 2.7711327311433,3.94721689059501 2.74433781190019,4.04721689059501 2.7711327311433,4.14721689059501 2.84433781190019,4.2204219713519 2.94433781190019,4.24721689059501 5.4595009596929,4.51976967370442 5.6595009596929,4.46617983521819 5.80591112120667,4.31976967370441 5.8595009596929,4.11976967370441 5.80591112120667,3.91976967370441 5.6595009596929,3.77335951219064 5.4595009596929,3.71976967370441 2.94433781190019,3.84721689059501</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.58042226487524,3.3468330134357 5.78042226487524,3.29324317494948 5.92683242638902,3.1468330134357 5.98042226487524,2.9468330134357 5.92683242638902,2.7468330134357 5.78042226487524,2.60042285192193 5.58042226487524,2.5468330134357 3.0,2.8 2.9,2.82679491924311 2.82679491924311,2.9 2.8,3.0 2.82679491924311,3.1 2.9,3.17320508075689 3.0,3.2 5.58042226487524,3.3468330134357</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:tapered_buffer_multilinev2>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://ogr.maptools.org/" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="1.0">
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureCollectionType">
<xs:attribute name="lockId" type="xs:string" use="optional"/>
<xs:attribute name="scope" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="tapered_buffer_multilinev2" type="ogr:tapered_buffer_multilinev2_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="tapered_buffer_multilinev2_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
Expand Up @@ -563,8 +563,14 @@ tests:
START_WIDTH: 0.4
results:
OUTPUT:
name: expected/tapered_buffer_multiline.gml
name:
- expected/tapered_buffer_multiline.gml
- expected/tapered_buffer_multilinev2.gml
type: vector
compare:
geometry:
topo_equal_check: True


- algorithm: native:bufferbym
name: Variable width buffer by m
Expand Down

0 comments on commit da76d9e

Please sign in to comment.