I have a WFS 2.0.0 GetFeature request which filters on BBOX and some feature property value. If I use XML encoding of the request and POST it to my server (using the Demo Pages) I get a response with 5 features. However, if I extract the filter part of the query and pass it urlencoded as the value of the KVP FILTER parameter then 0 features are returned.
At the time of writing my service is available at http://ogc.bgs.ac.uk/digmap625k_gsml32_gs/ and is running the 2014-02-18 nightly build of the 2.4.x branch.
The query in XML format which returns 5 features when posted is:
<?xml version=“1.0” encoding=“UTF-8”?>
<GetFeature xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
ÃÂ ÃÂ xsi:schemaLocation=“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”
ÃÂ ÃÂ xmlns=“http://www.opengis.net/wfs/2.0”
ÃÂ ÃÂ xmlns:gsml=“http://xmlns.geosciml.org/GeoSciML-Core/3.2”
ÃÂ ÃÂ xmlns:fes=“http://www.opengis.net/fes/2.0”
ÃÂ ÃÂ xmlns:xlink=“http://www.w3.org/1999/xlink”
ÃÂ ÃÂ xmlns:gml=“http://www.opengis.net/gml/3.2” version=“2.0.0” service=“WFS”
ÃÂ ÃÂ count=“100”>
ÃÂ ÃÂ <Query typeNames=“gsml:MappedFeature” srsName=“urn:ogc:def:crs:EPSG::4326”>
ÃÂ ÃÂ ÃÂ <fes:Filter>
ÃÂ ÃÂ ÃÂ ÃÂ <fes:And>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ <fes:PropertyIsEqualTo>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ <fes:ValueReference>gsml:specification/gsmlgu:GeologicUnit/gsml:relatedFeature/gsmlga:GeologicHistory/gsml:relatedFeature/gsmlga:GeologicEvent/gsmlga:olderNamedAge/@xlink:href</fes:ValueReference>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ <fes:Literal>http://resource.geosciml.org/classifier/ics/ischart/Visean</fes:Literal>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ </fes:PropertyIsEqualTo>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ <fes:BBOX>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ <fes:ValueReference>gsml:shape</fes:ValueReference>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ <gml:Envelope srsName=“urn:ogc:def:crs:EPSG::4326”>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ <gml:lowerCorner>56.08643859340388
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ -4.0004826736994445</gml:lowerCorner>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ <gml:upperCorner>56.165510496146474
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ -3.8381055732299343</gml:upperCorner>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ </gml:Envelope>
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ </fes:BBOX>
ÃÂ ÃÂ ÃÂ ÃÂ </fes:And>
ÃÂ ÃÂ ÃÂ </fes:Filter>
ÃÂ ÃÂ </Query>
</GetFeature>
I took out the fes:filter element and added the required namespace declarations to give:
<fes:Filter
xmlns:gsml=“http://xmlns.geosciml.org/GeoSciML-Core/3.2”
xmlns:fes=“http://www.opengis.net/fes/2.0”
xmlns:gml=“http://www.opengis.net/gml/3.2”
>
<fes:And>
<fes:PropertyIsEqualTo>
<fes:ValueReference>gsml:specification/gsmlgu:GeologicUnit/gsml:relatedFeature/gsmlga:GeologicHistory/gsml:relatedFeature/gsmlga:GeologicEvent/gsmlga:olderNamedAge/@xlink:href</fes:ValueReference>
<fes:Literal>http://resource.geosciml.org/classifier/ics/ischart/Visean</fes:Literal>
</fes:PropertyIsEqualTo>
<fes:BBOX>
<fes:ValueReference>gsml:shape</fes:ValueReference>
<gml:Envelope srsName=“urn:ogc:def:crs:EPSG::4326”>
<gml:lowerCorner>56.08643859340388 -4.0004826736994445</gml:lowerCorner>
<gml:upperCorner>56.165510496146474 -3.8381055732299343</gml:upperCorner>
</gml:Envelope>
</fes:BBOX>
</fes:And>
</fes:Filter>
URL encoding the above and creating a GET KVP request gives:
http://ogc.bgs.ac.uk/digmap625k_gsml32_gs/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=gsml:MappedFeature&FILTER=%3Cfes%3AFilter%0A%20xmlns%3Agsml%3D%22http%3A%2F%2Fxmlns.geosciml.org%2FGeoSciML-Core%2F3.2%22%0A%20xmlns%3Afes%3D%22http%3A%2F%2Fwww.opengis.net%2Ffes%2F2.0%22%0A%20xmlns%3Agml%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%2F3.2%22%0A%20%3E%0A%3Cfes%3AAnd%3E%0A%3Cfes%3APropertyIsEqualTo%3E%0A%3Cfes%3AValueReference%3Egsml%3Aspecification%2Fgsmlgu%3AGeologicUnit%2Fgsml%3ArelatedFeature%2Fgsmlga%3AGeologicHistory%2Fgsml%3ArelatedFeature%2Fgsmlga%3AGeologicEvent%2Fgsmlga%3AolderNamedAge%2F%40xlink%3Ahref%3C%2Ffes%3AValueReference%3E%0A%3Cfes%3ALiteral%3Ehttp%3A%2F%2Fresource.geosciml.org%2Fclassifier%2Fics%2Fischart%2FVisean%3C%2Ffes%3ALiteral%3E%0A%3C%2Ffes%3APropertyIsEqualTo%3E%0A%3Cfes%3ABBOX%3E%0A%3Cfes%3AValueReference%3Egsml%3Ashape%3C%2Ffes%3AValueReference%3E%0A%3Cgml%3AEnvelope%20srsName%3D%22urn%3Aogc%3Adef%3Acrs%3AEPSG%3A%3A4326%22%3E%0A%3Cgml%3AlowerCorner%3E56.08643859340388%20-4.0004826736994445%3C%2Fgml%3AlowerCorner%3E%0A%3Cgml%3AupperCorner%3E56.165510496146474%20-3.8381055732299343%3C%2Fgml%3AupperCorner%3E%0A%3C%2Fgml%3AEnvelope%3E%0A%3C%2Ffes%3ABBOX%3E%0A%3C%2Ffes%3AAnd%3E%0A%3C%2Ffes%3AFilter%3E&
The above results in 0 features returned, however.
I think POSTing the XML query and GETting the above query should give the same results.
If I simplify the query to only include the BBOX part without the olderNamedAge property query then both XML POST and url encoded filter XML in KVP GET seem to give the same results.
|