Skip to content

Commit

Permalink
Fix test on newer GEOS versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored and github-actions[bot] committed Dec 14, 2024
1 parent ac3faf3 commit a7f5337
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 2 deletions.
1 change: 0 additions & 1 deletion .ci/test_blocklist_qt6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ PyQgsServerWMSGetMap
PyQgsServerAccessControlWFSTransactional
PyQgsServerWFS
ProcessingQgisAlgorithmsTestPt2
ProcessingQgisAlgorithmsTestPt3
ProcessingQgisAlgorithmsTestPt4
ProcessingGdalAlgorithmsVectorTest
ProcessingGrassAlgorithmsImageryTest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
gml:id="aFeatureCollection"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ voronoi_buffer_geos312.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml/3.2">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5.8 -0.8</gml:lowerCorner><gml:upperCorner>3.8 8.8</gml:upperCorner></gml:Envelope></gml:boundedBy>

<ogr:featureMember>
<ogr:voronoi_buffer_geos312 gml:id="voronoi_buffer_geos312.0">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-1 -0.8</gml:lowerCorner><gml:upperCorner>3.8 2.5</gml:upperCorner></gml:Envelope></gml:boundedBy>
<ogr:geometryProperty><gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326" gml:id="voronoi_buffer_geos312.geom.0"><gml:exterior><gml:LinearRing><gml:posList>3.8 -0.8 3.8 -0.8 0.5 2.5 -1 2.5 0.65 -0.8 3.8 -0.8</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogr:geometryProperty>
<ogr:fid>points.0</ogr:fid>
<ogr:id>1</ogr:id>
<ogr:id2>2</ogr:id2>
</ogr:voronoi_buffer_geos312>
</ogr:featureMember>
<ogr:featureMember>
<ogr:voronoi_buffer_geos312 gml:id="voronoi_buffer_geos312.1">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-3 2.5</gml:lowerCorner><gml:upperCorner>2.16666666666667 5.7</gml:upperCorner></gml:Envelope></gml:boundedBy>
<ogr:geometryProperty><gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326" gml:id="voronoi_buffer_geos312.geom.1"><gml:exterior><gml:LinearRing><gml:posList>0.5 2.5 1.83333333333333 3.16666666666667 2.16666666666667 3.83333333333333 0.3 5.7 -3 3.5 -1 2.5 0.5 2.5</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogr:geometryProperty>
<ogr:fid>points.4</ogr:fid>
<ogr:id>5</ogr:id>
<ogr:id2>1</ogr:id2>
</ogr:voronoi_buffer_geos312>
</ogr:featureMember>
<ogr:featureMember>
<ogr:voronoi_buffer_geos312 gml:id="voronoi_buffer_geos312.2">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5.8 -0.8</gml:lowerCorner><gml:upperCorner>-3 5.1</gml:upperCorner></gml:Envelope></gml:boundedBy>
<ogr:geometryProperty><gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326" gml:id="voronoi_buffer_geos312.geom.2"><gml:exterior><gml:LinearRing><gml:posList>-5.8 -0.8 -3 -0.8 -3 3.5 -5.8 5.1 -5.8 -0.8</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogr:geometryProperty>
<ogr:fid>points.5</ogr:fid>
<ogr:id>6</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:voronoi_buffer_geos312>
</ogr:featureMember>
<ogr:featureMember>
<ogr:voronoi_buffer_geos312 gml:id="voronoi_buffer_geos312.3">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-3 -0.8</gml:lowerCorner><gml:upperCorner>0.65 3.5</gml:upperCorner></gml:Envelope></gml:boundedBy>
<ogr:geometryProperty><gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326" gml:id="voronoi_buffer_geos312.geom.3"><gml:exterior><gml:LinearRing><gml:posList>0.65 -0.8 -1 2.5 -3 3.5 -3 -0.8 0.65 -0.8</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogr:geometryProperty>
<ogr:fid>points.8</ogr:fid>
<ogr:id>9</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:voronoi_buffer_geos312>
</ogr:featureMember>
<ogr:featureMember>
<ogr:voronoi_buffer_geos312 gml:id="voronoi_buffer_geos312.4">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>0.5 -0.8</gml:lowerCorner><gml:upperCorner>3.8 3.16666666666667</gml:upperCorner></gml:Envelope></gml:boundedBy>
<ogr:geometryProperty><gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326" gml:id="voronoi_buffer_geos312.geom.4"><gml:exterior><gml:LinearRing><gml:posList>3.8 1.2 1.83333333333333 3.16666666666667 0.5 2.5 3.8 -0.8 3.8 1.2</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogr:geometryProperty>
<ogr:fid>points.2</ogr:fid>
<ogr:id>3</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:voronoi_buffer_geos312>
</ogr:featureMember>
<ogr:featureMember>
<ogr:voronoi_buffer_geos312 gml:id="voronoi_buffer_geos312.5">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>1.83333333333333 1.2</gml:lowerCorner><gml:upperCorner>3.8 4.65</gml:upperCorner></gml:Envelope></gml:boundedBy>
<ogr:geometryProperty><gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326" gml:id="voronoi_buffer_geos312.geom.5"><gml:exterior><gml:LinearRing><gml:posList>3.8 4.65 2.16666666666667 3.83333333333333 1.83333333333333 3.16666666666667 3.8 1.2 3.8 4.65</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogr:geometryProperty>
<ogr:fid>points.1</ogr:fid>
<ogr:id>2</ogr:id>
<ogr:id2>1</ogr:id2>
</ogr:voronoi_buffer_geos312>
</ogr:featureMember>
<ogr:featureMember>
<ogr:voronoi_buffer_geos312 gml:id="voronoi_buffer_geos312.6">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>0.3 3.83333333333333</gml:lowerCorner><gml:upperCorner>3.8 8.8</gml:upperCorner></gml:Envelope></gml:boundedBy>
<ogr:geometryProperty><gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326" gml:id="voronoi_buffer_geos312.geom.6"><gml:exterior><gml:LinearRing><gml:posList>3.8 8.8 2.8 8.8 1.5 7.5 0.3 5.7 2.16666666666667 3.83333333333333 3.8 4.65 3.8 8.8</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogr:geometryProperty>
<ogr:fid>points.3</ogr:fid>
<ogr:id>4</ogr:id>
<ogr:id2>2</ogr:id2>
</ogr:voronoi_buffer_geos312>
</ogr:featureMember>
<ogr:featureMember>
<ogr:voronoi_buffer_geos312 gml:id="voronoi_buffer_geos312.7">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5.8 3.5</gml:lowerCorner><gml:upperCorner>1.5 7.5</gml:upperCorner></gml:Envelope></gml:boundedBy>
<ogr:geometryProperty><gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326" gml:id="voronoi_buffer_geos312.geom.7"><gml:exterior><gml:LinearRing><gml:posList>-5.8 5.1 -3 3.5 0.3 5.7 1.5 7.5 -5.8 7.5 -5.8 5.1</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogr:geometryProperty>
<ogr:fid>points.7</ogr:fid>
<ogr:id>8</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:voronoi_buffer_geos312>
</ogr:featureMember>
<ogr:featureMember>
<ogr:voronoi_buffer_geos312 gml:id="voronoi_buffer_geos312.8">
<gml:boundedBy><gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326"><gml:lowerCorner>-5.8 7.5</gml:lowerCorner><gml:upperCorner>2.8 8.8</gml:upperCorner></gml:Envelope></gml:boundedBy>
<ogr:geometryProperty><gml:Polygon srsName="urn:ogc:def:crs:EPSG::4326" gml:id="voronoi_buffer_geos312.geom.8"><gml:exterior><gml:LinearRing><gml:posList>-5.8 8.8 -5.8 7.5 1.5 7.5 2.8 8.8 -5.8 8.8</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogr:geometryProperty>
<ogr:fid>points.6</ogr:fid>
<ogr:id>7</ogr:id>
<ogr:id2>0</ogr:id2>
</ogr:voronoi_buffer_geos312>
</ogr:featureMember>
</ogr:FeatureCollection>
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?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/3.2"
xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0"
elementFormDefault="qualified"
version="1.0">
<xs:annotation>
<xs:appinfo source="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd">
<gmlsf:ComplianceLevel>0</gmlsf:ComplianceLevel>
</xs:appinfo>
</xs:annotation>
<xs:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
<xs:import namespace="http://www.opengis.net/gmlsf/2.0" schemaLocation="http://schemas.opengis.net/gmlsfProfile/2.0/gmlsfLevels.xsd"/>
<xs:element name="FeatureCollection" type="ogr:FeatureCollectionType" substitutionGroup="gml:AbstractFeature"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="featureMember">
<xs:complexType>
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureMemberType">
<xs:sequence>
<xs:element ref="gml:AbstractFeature"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="voronoi_buffer_geos312" type="ogr:voronoi_buffer_geos312_Type" substitutionGroup="gml:AbstractFeature"/>
<xs:complexType name="voronoi_buffer_geos312_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:SurfacePropertyType" nillable="true" minOccurs="0" maxOccurs="1"/> <!-- restricted to Polygon --><!-- srsName="urn:ogc:def:crs:EPSG::4326" -->
<xs:element name="fid" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>
</xs:element>
<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>
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ tests:
pk: id

- algorithm: native:voronoipolygons
name: Vornoi with buffer region
name: Voronoi with buffer region (GEOS < 3.12)
condition:
geos:
less_than: 31200
params:
BUFFER: 10.0
INPUT:
Expand All @@ -282,6 +285,28 @@ tests:
name: expected/voronoi_buffer.gml
type: vector
pk: id
compare:
geometry:
normalize: True

- algorithm: native:voronoipolygons
name: Voronoi with buffer region (GEOS 3.12+)
condition:
geos:
at_least: 31200
params:
BUFFER: 10.0
INPUT:
name: points.gml
type: vector
results:
OUTPUT:
name: expected/voronoi_buffer_geos312.gml
type: vector
pk: id
compare:
geometry:
normalize: True

- algorithm: native:voronoipolygons
name: Voronoi without source attributes
Expand Down
2 changes: 2 additions & 0 deletions python/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ def checkGeometriesEqual(
equal,
""
" Features (Expected fid: {}, Result fid: {}) differ in geometry with method {}: \n\n"
" {}\n"
" At given precision ({}):\n"
" Expected geometry: {}\n"
" Result geometry: {}\n\n"
Expand All @@ -760,6 +761,7 @@ def checkGeometriesEqual(
geom0_id,
geom1_id,
"geos" if topo_equal_check else "wkt",
"Normalized" if normalize else "Not-normalized",
precision,
geom0_wkt if not geom0_is_null else "NULL",
geom1_wkt if not geom1_is_null else "NULL",
Expand Down

0 comments on commit a7f5337

Please sign in to comment.