Feature request #20393

Enhance QGIS Filter to use Geoserver filter function

Added by Stefan Overkamp almost 6 years ago.

Status:Open
Priority:Normal
Assignee:Even Rouault
Category:Web Services clients/WFS
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:28213

Description

I have a wfs layer with an attribute "route" and filter this layer to show only segments belonging to selected routes.

QGIS translates the filter (e.g. route IN (13, 331)) to following filter in the GetFeature request:

&FILTER=<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0"> <fes:Or> <fes:PropertyIsEqualTo> <fes:ValueReference>route</fes:ValueReference> <fes:Literal>13</fes:Literal> </fes:PropertyIsEqualTo> <fes:PropertyIsEqualTo> <fes:ValueReference>route</fes:ValueReference> <fes:Literal>331</fes:Literal> </fes:PropertyIsEqualTo> </fes:Or></fes:Filter>

Filtering more than 38 routes Geoserver is returning "Bad Request" maybe because the filter parameter gets too long (?).

Geoserver supports the in-Function.
in candidate:Object, v1:Object, v2:Object, … Works exactly the same as the in2, …, in10 functions described above, but takes any number of values as input.

Following filter returns the same result but is smaller than multiple PropertyIsEqualTo:

&FILTER=<fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0"> <fes:PropertyIsEqualTo> <fes:Function name="in"> <fes:ValueReference>route</fes:ValueReference> <fes:Literal>13</fes:Literal> <fes:Literal>331</fes:Literal> </fes:Function> <fes:Literal>true</fes:Literal> </fes:PropertyIsEqualTo> </fes:Filter>

Please translate the qgis IN-Filter to correspondent fes filter function.

Also available in: Atom PDF