Skip to content
Permalink
Browse files

Added a test for VoronoiPolygon.py that covers some new cases

  • Loading branch information
havatv authored and nyalldawson committed Aug 7, 2018
1 parent 42332f2 commit 4b1bc82ca1c6ff69fc940161bffb6eb4c03b1424
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ pointsvoronoi1diagram.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-0.6</gml:X><gml:Y>51.4</gml:Y></gml:coord>
<gml:coord><gml:X>0.2000000000000001</gml:X><gml:Y>51.6</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:pointsvoronoi1diagram fid="pointsvoronoi1.5">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-0.6,51.4 -0.6,51.5 -0.5,51.5 -0.5,51.4 -0.6,51.4</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>10</ogr:id>
</ogr:pointsvoronoi1diagram>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1diagram fid="pointsvoronoi1.2">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-0.5,51.5 -0.5,51.6 -0.275,51.6 -0.325,51.5 -0.5,51.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>7</ogr:id>
</ogr:pointsvoronoi1diagram>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1diagram fid="pointsvoronoi1.3">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-0.5,51.4 -0.5,51.5 -0.325,51.5 -0.275,51.4 -0.5,51.4</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>8</ogr:id>
</ogr:pointsvoronoi1diagram>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1diagram fid="pointsvoronoi1.0">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-0.275,51.4 -0.325,51.5 -0.275,51.6 0.0,51.6 0.0,51.4 -0.275,51.4</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>1</ogr:id>
</ogr:pointsvoronoi1diagram>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1diagram fid="pointsvoronoi1.1">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0.0,51.4 0.0,51.6 0.2,51.6 0.2,51.4 0.0,51.4</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>2</ogr:id>
</ogr:pointsvoronoi1diagram>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1diagram fid="pointsvoronoi1.4">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-0.6,51.5 -0.6,51.6 -0.5,51.6 -0.5,51.5 -0.6,51.5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:id>9</ogr:id>
</ogr:pointsvoronoi1diagram>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ pointsvoronoi1.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>-0.6</gml:X><gml:Y>51.4</gml:Y></gml:coord>
<gml:coord><gml:X>0.2</gml:X><gml:Y>51.6</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:pointsvoronoi1 fid="pointsvoronoi1.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-0.2,51.5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>1</ogr:id>
</ogr:pointsvoronoi1>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1 fid="pointsvoronoi1.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0.2,51.5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>2</ogr:id>
</ogr:pointsvoronoi1>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1 fid="pointsvoronoi1.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-0.4,51.6</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>7</ogr:id>
</ogr:pointsvoronoi1>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1 fid="pointsvoronoi1.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-0.4,51.4</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>8</ogr:id>
</ogr:pointsvoronoi1>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1 fid="pointsvoronoi1.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-0.6,51.6</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>9</ogr:id>
</ogr:pointsvoronoi1>
</gml:featureMember>
<gml:featureMember>
<ogr:pointsvoronoi1 fid="pointsvoronoi1.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>-0.6,51.4</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>10</ogr:id>
</ogr:pointsvoronoi1>
</gml:featureMember>
</ogr:FeatureCollection>
@@ -3583,6 +3583,18 @@ tests:
name: expected/voronoi_buffer.gml
type: vector

- algorithm: qgis:voronoipolygons
name: Vornoi with vertical and horizontal Voronoi edges
params:
BUFFER: 0.0
INPUT:
name: pointsvoronoi1.gml
type: vector
results:
OUTPUT:
name: expected/pointsvoronoi1diagram.gml
type: vector

- algorithm: native:explodelines
name: Explode lines
params:

0 comments on commit 4b1bc82

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