In GeoServer, I installed an app-schema linked to a PostGIS database. When I call the layer via the WFS GetFeature I have an INSPIRE compliant GML file that looks like (small portion of the GML):

<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sams="http://www.opengis.net/samplingSpatial/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:nurc="http://www.nurc.nato.int" xmlns:tiger="http://www.census.gov" xmlns:topp="http://www.openplans.org/topp" xmlns:omso="http://inspire.ec.europa.eu/schemas/omso/3.0" xmlns:sf="http://www.openplans.org/spearfish" xmlns:sde="http://geoserver.sf.net" xmlns:nns__3="http://www.opengis.net/sampling/2.0" xmlns:cite="http://www.opengeospatial.net/cite" xmlns:nns__4="http://www.opengis.net/swe/2.0" xmlns:it.geosolutions="http://www.geo-solutions.it" xmlns:om="http://www.opengis.net/om/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="unknown" numberReturned="50" timeStamp="2018-11-13T13:27:39.776Z" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://localhost:8080/geoserver/schemas/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://localhost:8080/geoserver/schemas/gml/3.2.1/gml.xsd http://inspire.ec.europa.eu/schemas/omso/3.0 http://inspire.ec.europa.eu/schemas/omso/3.0/SpecialisedObservations.xsd">
    <omso:PointObservation gml:id="all_values.fid-60e72fae_1670d1c707c_-7d40">    
        <om:parameter xlink:href="ef.EnvironmentalMonitoringFacility.marine.BEFED_ZG03">
              <om:name xlink:href="https://inspire.ec.europa.eu/theme/ef"/>

However this app-schema is linked to my entire database (+-2millions points) so I need to be able to filter the GML generated. To perform that I used to use the "viewParams" filter (e.g. http://localhost:8080/geoserver/omso/ows?service=WFS&version=1.1.0&request=GetFeature&typeName=omso%3APointObservation&viewParams=value:ZG03 )

That worked fine for simple features. Now I need to filter on nested property of complex features but I don't know whether it is possible or how to do it.

For instance, how could I extract points from my db where the parameter value is "ZG03" (see GML extract above)?


Based on what you suggested. I try to use the filter function but still can't make it works. Here is the code I'm using:

<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0"

Any suggestion?


Actually, an answer could be that the schema is not directly visible to the filter. I explain. The schema I use is the INSPIRE specialisedObservation.xsd. If I check the schema with wfs function DescribeFeatureType, the answer is only:

<xsd:schema elementFormDefault="qualified" targetNamespace="http://inspire.ec.europa.eu/schemas/omso/3.0"><xsd:include schemaLocation="http://inspire.ec.europa.eu/schemas/omso/3.0/SpecialisedObservations.xsd"/></xsd:schema>

So the element I'm looking for is not located directly there, but is in another schema imported at the beginning of the SpecializedObservations.xsd schema

<import namespace="http://www.opengis.net/om/2.0" schemaLocation="http://schemas.opengis.net/om/2.0/observation.xsd"/>

Could this explain why the filter function is not working properly?

  • do you have a public copy of the XML schema you are using?
    – nmtoken
    Nov 13, 2018 at 14:47
  • It's the INSPIRE Specialized Observation schema available here: inspire.ec.europa.eu/schemas/omso/3.0/… Nov 13, 2018 at 14:53
  • The server should be aware of the schema and apply the filter, if it's correct. The issue if any is in the clients ability to parse the schema to create a correct filter.
    – nmtoken
    Jan 28, 2020 at 16:12

3 Answers 3


Support for viewParams is up to the specific datastore, the needs to be special code to handle them. For example, here is the handling of view params in JDBC data stores (e.g., PostGIS, Oracle, SQL Server and so on), as part of the "SQL view" mechanism (dubbed "virtual table" down in GeoTools):


Only a couple of other stores support some notion of view params, like SOLR and ElasticSearch.

App-schema has no support for view params at the moment.


In general it is easiest (and most efficient) to use a filter to restrict the features returned by your WFS request.

So in your case I think you would need something like:

<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:om=".....">
      <om:name xlink:href="https://inspire.ec.europa.eu/theme/ef"/>
  • and is there a way to translate the filter function in the GetFeature request? What I need eventually is a link to download the data from a GeoNetwork Nov 13, 2018 at 15:23
  • just add filter= and the URLencoded value of the filter
    – Ian Turton
    Nov 13, 2018 at 15:40

I think you'll need something like below (HTTP POST) request

<GetFeature version="2.0.0" service="WFS" 
  <Query typeNames="omso:PointObservation">
    <Filter xmlns="http://www.opengis.net/fes/2.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ef="https://inspire.ec.europa.eu/theme/ef">
        <ValueReference>{XPath to the location of the property}</ValueReference>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.