Skip to content
Permalink
Browse files

Add unit test for wedge buffers alg

  • Loading branch information
nyalldawson committed Apr 23, 2018
1 parent b884eb4 commit 2850b308bac1623060e73ef4ee80d7511474d5b6
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ wedge_buffers.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>0.4619397662556434</gml:X><gml:Y>-5.38268343236509</gml:Y></gml:coord>
<gml:coord><gml:X>8.999362825657043</gml:X><gml:Y>3.38268343236509</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:wedge_buffers fid="points.0">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1.92387953251129,1.38268343236509 1.94882591683734,1.31579958761506 1.96893730178152,1.24730650055423 1.98411120433616,1.17755319625434 1.99427030177191,1.10689512156512 1.99936282565704,1.03569233383899 1.99936282565704,0.964307666161034 1.99427030177191,0.893104878434911 1.98411120433616,0.82244680374572 1.96893730178152,0.752693499445783 1.94882591683734,0.684200412384996 1.92387953251129,0.61731656763491 1.46193976625564,0.808658283817455 1.47441295841867,0.842100206192498 1.48446865089079,0.876346749722884 1.49205560216808,0.91122340187286 1.49713515088598,0.94655243921747 1.49968141282852,0.982153833080531 1.49968141282852,1.01784616691953 1.49713515088598,1.05344756078256 1.49205560216808,1.0887765981272 1.48446865089079,1.1236532502771 1.47441295841867,1.15789979380753 1.46193976625564,1.19134171618254 1.92387953251129,1.38268343236509</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>1</ogr:id>
<ogr:id2>2</ogr:id2>
</ogr:wedge_buffers>
</gml:featureMember>
<gml:featureMember>
<ogr:wedge_buffers fid="points.1">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3.92387953251129,3.38268343236509 3.94882591683734,3.31579958761506 3.96893730178158,3.2473065005542 3.98411120433616,3.17755319625439 3.99427030177196,3.10689512156512 3.99936282565704,3.03569233383905 3.99936282565704,2.96430766616106 3.99427030177196,2.893104878435 3.98411120433616,2.82244680374572 3.96893730178158,2.7526934994458 3.94882591683734,2.68420041238505 3.92387953251129,2.61731656763491 3.46193976625564,2.80865828381746 3.47441295841872,2.84210020619253 3.48446865089079,2.87634674972293 3.49205560216808,2.91122340187292 3.49713515088604,2.9465524392175 3.49968141282852,2.98215383308059 3.49968141282852,3.01784616691953 3.49713515088604,3.05344756078261 3.49205560216808,3.0887765981272 3.48446865089079,3.12365325027707 3.47441295841872,3.15789979380759 3.46193976625564,3.19134171618254 3.92387953251129,3.38268343236509</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>2</ogr:id>
<ogr:id2>1</ogr:id2>
</ogr:wedge_buffers>
</gml:featureMember>
<gml:featureMember>
<ogr:wedge_buffers fid="points.2">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.92387953251129,2.38268343236509 2.94882591683734,2.31579958761506 2.96893730178158,2.2473065005542 2.98411120433616,2.17755319625439 2.99427030177196,2.10689512156512 2.99936282565704,2.03569233383905 2.99936282565704,1.96430766616106 2.99427030177196,1.89310487843494 2.98411120433616,1.82244680374572 2.96893730178158,1.75269349944577 2.94882591683734,1.684200412385 2.92387953251129,1.61731656763491 2.46193976625564,1.80865828381746 2.47441295841872,1.84210020619253 2.48446865089079,1.8763467497229 2.49205560216808,1.91122340187286 2.49713515088604,1.9465524392175 2.49968141282852,1.98215383308053 2.49968141282852,2.01784616691953 2.49713515088604,2.05344756078261 2.49205560216808,2.0887765981272 2.48446865089079,2.12365325027707 2.47441295841872,2.15789979380759 2.46193976625564,2.19134171618254 2.92387953251129,2.38268343236509</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>3</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:wedge_buffers>
</gml:featureMember>
<gml:featureMember>
<ogr:wedge_buffers fid="points.3">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5.92387953251129,2.38268343236509 5.94882591683745,2.31579958761506 5.96893730178158,2.2473065005542 5.98411120433616,2.17755319625439 5.99427030177208,2.10689512156512 5.99936282565704,2.03569233383905 5.99936282565704,1.96430766616106 5.99427030177208,1.89310487843494 5.98411120433616,1.82244680374572 5.96893730178158,1.75269349944577 5.94882591683745,1.684200412385 5.92387953251129,1.61731656763491 5.46193976625564,1.80865828381746 5.47441295841872,1.84210020619253 5.4844686508909,1.8763467497229 5.49205560216819,1.91122340187286 5.49713515088615,1.9465524392175 5.49968141282852,1.98215383308053 5.49968141282852,2.01784616691953 5.49713515088615,2.05344756078261 5.49205560216819,2.0887765981272 5.4844686508909,2.12365325027707 5.47441295841872,2.15789979380759 5.46193976625564,2.19134171618254 5.92387953251129,2.38268343236509</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>4</ogr:id>
<ogr:id2>2</ogr:id2>
</ogr:wedge_buffers>
</gml:featureMember>
<gml:featureMember>
<ogr:wedge_buffers fid="points.4">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.92387953251129,1.38268343236509 4.94882591683745,1.31579958761506 4.96893730178158,1.24730650055423 4.98411120433616,1.17755319625434 4.99427030177208,1.10689512156512 4.99936282565704,1.03569233383899 4.99936282565704,0.964307666161034 4.99427030177208,0.893104878434911 4.98411120433616,0.82244680374572 4.96893730178158,0.752693499445783 4.94882591683745,0.684200412384996 4.92387953251129,0.61731656763491 4.46193976625564,0.808658283817455 4.47441295841872,0.842100206192498 4.4844686508909,0.876346749722884 4.49205560216819,0.91122340187286 4.49713515088615,0.94655243921747 4.49968141282852,0.982153833080531 4.49968141282852,1.01784616691953 4.49713515088615,1.05344756078256 4.49205560216819,1.0887765981272 4.4844686508909,1.1236532502771 4.47441295841872,1.15789979380753 4.46193976625564,1.19134171618254 4.92387953251129,1.38268343236509</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>5</ogr:id>
<ogr:id2>1</ogr:id2>
</ogr:wedge_buffers>
</gml:featureMember>
<gml:featureMember>
<ogr:wedge_buffers fid="points.5">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0.923879532511287,-4.61731656763491 0.948825916837336,-4.68420041238505 0.968937301781523,-4.75269349944585 0.984111204336131,-4.82244680374583 0.994270301771905,-4.893104878435 0.999362825657016,-4.96430766616117 0.999362825657016,-5.03569233383905 0.994270301771905,-5.10689512156523 0.984111204336131,-5.17755319625439 0.968937301781523,-5.24730650055414 0.948825916837336,-5.31579958761517 0.923879532511287,-5.38268343236509 0.461939766255643,-5.19134171618254 0.474412958418668,-5.1578997938077 0.484468650890761,-5.12365325027702 0.492055602168065,-5.0887765981272 0.497135150885953,-5.05344756078261 0.499681412828508,-5.01784616691952 0.499681412828508,-4.9821538330807 0.497135150885953,-4.94655243921761 0.492055602168065,-4.91122340187303 0.484468650890761,-4.87634674972298 0.474412958418668,-4.84210020619253 0.461939766255643,-4.80865828381746 0.923879532511287,-4.61731656763491</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>6</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:wedge_buffers>
</gml:featureMember>
<gml:featureMember>
<ogr:wedge_buffers fid="points.6">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8.92387953251129,-0.61731656763491 8.94882591683745,-0.684200412384996 8.96893730178181,-0.752693499445783 8.98411120433638,-0.82244680374572 8.9942703017723,-0.893104878434911 8.99936282565704,-0.964307666161034 8.99936282565704,-1.03569233383899 8.9942703017723,-1.10689512156512 8.98411120433638,-1.17755319625434 8.96893730178181,-1.24730650055423 8.94882591683745,-1.31579958761506 8.92387953251129,-1.38268343236509 8.46193976625564,-1.19134171618254 8.47441295841872,-1.15789979380753 8.4844686508909,-1.1236532502771 8.49205560216842,-1.0887765981272 8.49713515088615,-1.05344756078256 8.49968141282852,-1.01784616691953 8.49968141282852,-0.982153833080531 8.49713515088615,-0.94655243921747 8.49205560216842,-0.91122340187286 8.4844686508909,-0.876346749722884 8.47441295841872,-0.842100206192498 8.46193976625564,-0.808658283817455 8.92387953251129,-0.61731656763491</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>7</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:wedge_buffers>
</gml:featureMember>
<gml:featureMember>
<ogr:wedge_buffers fid="points.7">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>7.92387953251129,-0.61731656763491 7.94882591683745,-0.684200412384996 7.96893730178158,-0.752693499445783 7.98411120433616,-0.82244680374572 7.99427030177208,-0.893104878434911 7.99936282565704,-0.964307666161034 7.99936282565704,-1.03569233383899 7.99427030177208,-1.10689512156512 7.98411120433616,-1.17755319625434 7.96893730178158,-1.24730650055423 7.94882591683745,-1.31579958761506 7.92387953251129,-1.38268343236509 7.46193976625564,-1.19134171618254 7.47441295841872,-1.15789979380753 7.4844686508909,-1.1236532502771 7.49205560216819,-1.0887765981272 7.49713515088615,-1.05344756078256 7.49968141282852,-1.01784616691953 7.49968141282852,-0.982153833080531 7.49713515088615,-0.94655243921747 7.49205560216819,-0.91122340187286 7.4844686508909,-0.876346749722884 7.47441295841872,-0.842100206192498 7.46193976625564,-0.808658283817455 7.92387953251129,-0.61731656763491</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>8</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:wedge_buffers>
</gml:featureMember>
<gml:featureMember>
<ogr:wedge_buffers fid="points.8">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0.923879532511287,-0.61731656763491 0.948825916837336,-0.684200412384996 0.968937301781523,-0.752693499445783 0.984111204336131,-0.82244680374572 0.994270301771905,-0.893104878434911 0.999362825657016,-0.964307666161034 0.999362825657016,-1.03569233383899 0.994270301771905,-1.10689512156512 0.984111204336131,-1.17755319625434 0.968937301781523,-1.24730650055423 0.948825916837336,-1.31579958761506 0.923879532511287,-1.38268343236509 0.461939766255643,-1.19134171618254 0.474412958418668,-1.15789979380753 0.484468650890761,-1.1236532502771 0.492055602168065,-1.0887765981272 0.497135150885953,-1.05344756078256 0.499681412828508,-1.01784616691953 0.499681412828508,-0.982153833080531 0.497135150885953,-0.94655243921747 0.492055602168065,-0.91122340187286 0.484468650890761,-0.876346749722884 0.474412958418668,-0.842100206192498 0.461939766255643,-0.808658283817455 0.923879532511287,-0.61731656763491</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>9</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:wedge_buffers>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,37 @@
<?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="wedge_buffers" type="ogr:wedge_buffers_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="wedge_buffers_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="id" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="id2" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
@@ -5243,4 +5243,19 @@ tests:
fields:
fid: skip

- algorithm: native:wedgebuffers
name: Wedge buffers
params:
AZIMUTH: 90.0
INNER_RADIUS: 0.5
INPUT:
name: points.gml
type: vector
OUTER_RADIUS: 1.0
WIDTH: 45.0
results:
OUTPUT:
name: expected/wedge_buffers.gml
type: vector

# See ../README.md for a description of the file format

0 comments on commit 2850b30

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