Skip to content

Commit

Permalink
test_provider_wfs.py: fix new test
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and nyalldawson committed Jul 20, 2022
1 parent 8d8e963 commit 555f9e8
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions tests/src/python/test_provider_wfs.py
Expand Up @@ -3539,18 +3539,18 @@ def testGetFeatureWithServerExpression(self):

with open(sanitize(endpoint,
"""?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=my:typename&SRSNAME=urn:ogc:def:crs:EPSG::4326&FILTER=<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2">
<fes:Intersects>
<fes:ValueReference>geometryProperty</fes:ValueReference>
<gml:Polygon gml:id="qgis_id_geom_1" srsName="urn:ogc:def:crs:EPSG::4326">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">-20 -20 20 -20 20 20 -20 20 -20 -20</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</fes:Intersects>
</fes:Filter>
"""),
<fes:Intersects>
<fes:ValueReference>geometryProperty</fes:ValueReference>
<gml:Polygon gml:id="qgis_id_geom_1" srsName="urn:ogc:def:crs:EPSG::4326">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">-20 -20 20 -20 20 20 -20 20 -20 -20</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</fes:Intersects>
</fes:Filter>
"""),
'wb') as f:
f.write("""
<wfs:FeatureCollection
Expand Down Expand Up @@ -3585,25 +3585,25 @@ def testGetFeatureWithServerExpression(self):
request.setFilterExpression("intersects( $geometry, geometry(var('parent')))")

with open(sanitize(endpoint,
"""?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=my:typename&SRSNAME=urn:ogc:def:crs:EPSG::4326&FILTER=<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2">
<fes:And>
<fes:Intersects>
<fes:ValueReference>geometryProperty</fes:ValueReference>
<gml:Polygon gml:id="qgis_id_geom_1" srsName="urn:ogc:def:crs:EPSG::4326">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">-20 -20 20 -20 20 20 -20 20 -20 -20</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</fes:Intersects>
<fes:PropertyIsEqualTo>
<fes:ValueReference>my:intfield</fes:ValueReference>
<fes:Literal>1</fes:Literal>
</fes:PropertyIsEqualTo>
</fes:And>
</fes:Filter>
"""),
"""?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=my:typename&SRSNAME=urn:ogc:def:crs:EPSG::4326&FILTER=<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0">
<fes:And>
<fes:Intersects xmlns:fes="http://www.opengis.net/fes/2.0">
<fes:ValueReference>geometryProperty</fes:ValueReference>
<gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2" gml:id="qgis_id_geom_1" srsName="urn:ogc:def:crs:EPSG::4326">
<gml:exterior xmlns:gml="http://www.opengis.net/gml/3.2">
<gml:LinearRing xmlns:gml="http://www.opengis.net/gml/3.2">
<gml:posList xmlns:gml="http://www.opengis.net/gml/3.2" srsDimension="2">-20 -20 20 -20 20 20 -20 20 -20 -20</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</fes:Intersects>
<fes:PropertyIsEqualTo xmlns:fes="http://www.opengis.net/fes/2.0">
<fes:ValueReference>my:intfield</fes:ValueReference>
<fes:Literal xmlns:fes="http://www.opengis.net/fes/2.0">1</fes:Literal>
</fes:PropertyIsEqualTo>
</fes:And>
</fes:Filter>
"""),
'wb') as f:
f.write("""
<wfs:FeatureCollection
Expand All @@ -3627,7 +3627,7 @@ def testGetFeatureWithServerExpression(self):
self.assertEqual(len(vl.fields()), 1)
self.assertEqual(vl.wkbType(), QgsWkbTypes.Point)

extent = QgsRectangle(-80, 60, -60, 89)
extent = QgsRectangle(-80, -70, 60, 50)
request = QgsFeatureRequest().setFilterRect(extent)

parent_feature = QgsFeature()
Expand All @@ -3641,32 +3641,32 @@ def testGetFeatureWithServerExpression(self):
request.setFilterExpression("intersects( $geometry, geometry(var('parent')))")

with open(sanitize(endpoint,
"""?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=my:typename&SRSNAME=urn:ogc:def:crs:EPSG::4326&FILTER=<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gml="http://www.opengis.net/gml/3.2">
<fes:And>
<fes:BBOX>
<fes:ValueReference>my:geometryProperty</fes:ValueReference>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::32631">
<gml:lowerCorner>-30 -30</gml:lowerCorner>
<gml:upperCorner>30 30</gml:upperCorner>
</gml:Envelope>
</fes:BBOX>
<fes:Intersects>
<fes:ValueReference>geometryProperty</fes:ValueReference>
<gml:Polygon gml:id="qgis_id_geom_1" srsName="urn:ogc:def:crs:EPSG::4326">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">-20 -20 20 -20 20 20 -20 20 -20 -20</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</fes:Intersects>
<fes:PropertyIsGreaterThan xmlns:fes="http://www.opengis.net/fes/2.0">
<fes:ValueReference>my:intfield</fes:ValueReference>
<fes:Literal xmlns:fes="http://www.opengis.net/fes/2.0">0</fes:Literal>
</fes:PropertyIsGreaterThan>
</fes:And>
</fes:Filter>
"""),
"""?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=my:typename&SRSNAME=urn:ogc:def:crs:EPSG::4326&FILTER=<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2">
<fes:And>
<fes:Intersects xmlns:fes="http://www.opengis.net/fes/2.0">
<fes:ValueReference>geometryProperty</fes:ValueReference>
<gml:Polygon xmlns:gml="http://www.opengis.net/gml/3.2" gml:id="qgis_id_geom_1" srsName="urn:ogc:def:crs:EPSG::4326">
<gml:exterior xmlns:gml="http://www.opengis.net/gml/3.2">
<gml:LinearRing xmlns:gml="http://www.opengis.net/gml/3.2">
<gml:posList xmlns:gml="http://www.opengis.net/gml/3.2" srsDimension="2">-20 -20 20 -20 20 20 -20 20 -20 -20</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</fes:Intersects>
<fes:BBOX>
<fes:ValueReference>my:geometryProperty</fes:ValueReference>
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326">
<gml:lowerCorner>-70 -80</gml:lowerCorner>
<gml:upperCorner>50 60</gml:upperCorner>
</gml:Envelope>
</fes:BBOX>
<fes:PropertyIsEqualTo xmlns:fes="http://www.opengis.net/fes/2.0">
<fes:ValueReference>my:intfield</fes:ValueReference>
<fes:Literal xmlns:fes="http://www.opengis.net/fes/2.0">1</fes:Literal>
</fes:PropertyIsEqualTo>
</fes:And>
</fes:Filter>
"""),
'wb') as f:
f.write("""
<wfs:FeatureCollection
Expand Down

0 comments on commit 555f9e8

Please sign in to comment.