Skip to content

Commit d4dc036

Browse files
WFS server: add support for <gml:Envelope> in <fes:Intersects>
1 parent 75e7d71 commit d4dc036

3 files changed

Lines changed: 57 additions & 0 deletions

File tree

mapogcfilter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,8 @@ static CPLXMLNode* FLTFindGeometryNode(CPLXMLNode* psXMLNode,
10381038
*pbPolygon = 1;
10391039
else if ((psGMLElement= CPLGetXMLNode(psXMLNode, "Box")))
10401040
*pbPolygon = 1;
1041+
else if ((psGMLElement= CPLGetXMLNode(psXMLNode, "Envelope")))
1042+
*pbPolygon = 1;
10411043
else if ((psGMLElement= CPLGetXMLNode(psXMLNode, "LineString")))
10421044
*pbLine = 1;
10431045
else if ((psGMLElement= CPLGetXMLNode(psXMLNode, "MultiLineString")))
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Content-Type: text/xml; subtype="gml/3.2.1"; charset=UTF-8
2+
3+
<?xml version='1.0' encoding="UTF-8" ?>
4+
<wfs:FeatureCollection
5+
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
6+
xmlns:gml="http://www.opengis.net/gml/3.2"
7+
xmlns:wfs="http://www.opengis.net/wfs/2.0"
8+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=2.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=popplace&amp;OUTPUTFORMAT=application%2Fgml%2Bxml%3B%20version%3D3.2 http://www.opengis.net/wfs/2.0 http://ogc.dmsolutions.ca/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://ogc.dmsolutions.ca/gml/3.2.1/gml.xsd"
10+
timeStamp="" numberMatched="1" numberReturned="1">
11+
<wfs:boundedBy>
12+
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326">
13+
<gml:lowerCorner>44.61104 -65.81602</gml:lowerCorner>
14+
<gml:upperCorner>44.61104 -65.81602</gml:upperCorner>
15+
</gml:Envelope>
16+
</wfs:boundedBy>
17+
<!-- WARNING: No featureid defined for typename 'popplace'. Output will not validate. -->
18+
<wfs:member>
19+
<ms:popplace>
20+
<gml:boundedBy>
21+
<gml:Envelope srsName="urn:ogc:def:crs:EPSG::4326">
22+
<gml:lowerCorner>44.61104 -65.81602</gml:lowerCorner>
23+
<gml:upperCorner>44.61104 -65.81602</gml:upperCorner>
24+
</gml:Envelope>
25+
</gml:boundedBy>
26+
<ms:msGeometry>
27+
<gml:Point gml:id=".1" srsName="urn:ogc:def:crs:EPSG::4326">
28+
<gml:pos>44.61104 -65.81602</gml:pos>
29+
</gml:Point>
30+
</ms:msGeometry>
31+
<ms:AREA>0.000</ms:AREA>
32+
<ms:PERIMETER>0.000</ms:PERIMETER>
33+
<ms:POPPLACE_>118</ms:POPPLACE_>
34+
<ms:POPPLACE_I>2</ms:POPPLACE_I>
35+
<ms:UNIQUE_KEY>CAJOA</ms:UNIQUE_KEY>
36+
<ms:NAME>Digby</ms:NAME>
37+
<ms:NAME_E></ms:NAME_E>
38+
<ms:NAME_F></ms:NAME_F>
39+
<ms:UNIQUE_K_1></ms:UNIQUE_K_1>
40+
<ms:UNIQUE_K_2></ms:UNIQUE_K_2>
41+
<ms:REG_CODE>12</ms:REG_CODE>
42+
<ms:NTS50>021A12</ms:NTS50>
43+
<ms:LAT>443700</ms:LAT>
44+
<ms:LONG>654600</ms:LONG>
45+
<ms:SGC_CODE>1203006</ms:SGC_CODE>
46+
<ms:CAPITAL>0</ms:CAPITAL>
47+
<ms:POP_RANGE>2</ms:POP_RANGE>
48+
</ms:popplace>
49+
</wfs:member>
50+
</wfs:FeatureCollection>
51+

msautotest/wxs/wfs_filter.map

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@
131131
# RUN_PARMS: wfs_filter_intersects.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=popplace&FILTER=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-61.63,45.04 -60.78,45.04 -60.78,46.08 -61.63,46.08</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>" > [RESULT]
132132
#
133133
# RUN_PARMS: wfs_filter_200_intersects.xml [MAPSERV] [POST]<?xml version="1.0"?><GetFeature service="WFS" version="2.0.0" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/fes/2.0 http://schemas.opengis.net/filter/2.0/filterAll.xsd http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"><Query typeNames="popplace"><fes:Filter><fes:Intersects><fes:ValueReference>Geometry</fes:ValueReference><gml:Polygon gml:id="bla" srsName="CRS:84"><gml:exterior><gml:LinearRing><gml:posList>-61.63 45.04 -60.78 45.04 -60.78 46.08 -61.63 46.08</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></fes:Intersects></fes:Filter></Query></GetFeature>[/POST] > [RESULT_DEVERSION]
134+
135+
#
136+
# RUN_PARMS: wfs_filter_200_intersects_envelope.xml [MAPSERV] [POST]<?xml version="1.0"?><GetFeature service="WFS" version="2.0.0" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns="http://www.opengis.net/wfs/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/fes/2.0 http://schemas.opengis.net/filter/2.0/filterAll.xsd http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd"><Query typeNames="popplace"><fes:Filter><fes:Intersects><fes:ValueReference>Geometry</fes:ValueReference><gml:Envelope srsName="urn:ogc:def:crs:EPSG::26920"><gml:lowerCorner>272868.16 4938053.09</gml:lowerCorner><gml:upperCorner>281261.3 4951109.39</gml:upperCorner></gml:Envelope></fes:Intersects></fes:Filter></Query></GetFeature>[/POST] > [RESULT_DEVERSION]
137+
134138
#
135139
# Verify DWITHIN Result: Sydney
136140
# RUN_PARMS: wfs_filter_dwithin.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=popplace&FILTER=<Filter><DWithin><PropertyName>Geometry</PropertyName><gml:Point><gml:coordinates>-60.18,46.10</gml:coordinates></gml:Point><Distance units='dd'>0.05</Distance></DWithin></Filter>" > [RESULT]

0 commit comments

Comments
 (0)