I am trying to create a filter to show only specific features based on an attribute query within a WFS using QGIS. This works fine when using the standard WFS loader and creating a filter (based on the type "attribute"='value'). However this only works when the features are cached.
I want to be able to use a filter like this for an uncached WFS layer. Does anyone have any idea how to do this?
Example using a BGS public WFS.
A standard cached query would look like this:
http://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/wms?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=GBR_BGS_625k_SLS&SRSNAME=CRS:84&FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>LEX_ROCK_D</ogc:PropertyName>
<ogc:Literal>PEAT</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
When I untick the cached option, the layer source is as follows:
http://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/wms?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=GBR_BGS_625k_SLS&SRSNAME=CRS:84&BBOX=-3.4085901736001083,57.05755199511002473,-2.94851240830698069,57.42328922738386154&FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>LEX_ROCK_D</ogc:PropertyName>
<ogc:Literal>PEAT</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
The main difference is the bounding box. What happens with the second layer definition is that the layer loads but has no features within it.
I am able to create a GeoServer layer within my WFS that meets this query, but I am trying to find a way that users will be able to replicate without intervention at the GeoServer end.