Thursday, 14 September 2017

How do I use a filter on an uncached WFS layer in QGIS?


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=

LEX_ROCK_D
PEAT



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=

LEX_ROCK_D
PEAT



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.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...