[Geoserver-devel] [jira] (GEOS-6364) app-schema incorrectly returns 0 features when XML filter passed in KVP FILTER parameter

Marcus Sen created an issue

GeoServer / BugGEOS-6364

app-schema incorrectly returns 0 features when XML filter passed in KVP FILTER parameter

Issue Type:

BugBug

Affects Versions:

2.4.5

Assignee:

Rini Angreani

Components:

Application schema

Created:

21/Feb/14 8:25 AM

Environment:

OS: Windows Server 2008 64bit
Servlet Container: Tomcat 7 64 bit
Java: 1.7 64 bit
Postgres 8.4 with PostGIS 1.5 running on a separate Windows Server 2003 machine.

Priority:

MajorMajor

Reporter:

Marcus Sen

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.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v6.1.6#6162-sha1:7af547c)

Atlassian logo