qgis / QGIS-Enhancement-Proposals

QEP's (QGIS Enhancement Proposals) are used in the process of creating and discussing new enhancements for QGIS
118 stars 37 forks source link

Add support for OGC Filter Encoding to WMS #104

Open pvalsecc opened 7 years ago

pvalsecc commented 7 years ago

QGIS Enhancement: Add support for OGC Filter Encoding to WMS

Date 2017/09/21

Author Patrick Valsecchi

Contact patrick.valsecchi@camptocamp.com

maintainer @pvalsecc

Version QGIS 3.0

Summary

The current WMS filter mechanism provided by QGIS is limited to QGIS specific expressions. This QEP proposes to add support of OGC Filter Encoding, following the same parameter format as MapServer and GeoServer.

Proposed Solution

Add another format for the WMS FILTER parameter that follows the current MapServer/GeoServer “standard”:

…&FILTER=(<filter>...filter for layer 1...</filter>)(<filter>...filter for layer 2...</filter>)...

In the code handling the WMS format parameter, if the value starts with “(<” or with “<” (both starting strings not possible with the current format), we split the filters for the different layers and generate the QgsFeatureRequest from the XML, using QgsWfs::parseFilterElement (moving this function to QgsOgc or something).

The answer to GetCapabilities from MapServer doesn’t contain any reference to the filtering. So no change there.

Example(s)

See http://mapserver.org/development/rfc/ms-rfc-118.html

Affected Files

Performance Implications

Should have no impact on queries using the current filter format and the performance should be similar for the OGC Filter Encoding format.

Backwards Compatibility

No problem there. The old format will still be supported.

Votes

(required)

pvalsecc commented 7 years ago

@rldhont, @rouault, an opinion on that? Anybody else to ask?

mhugent commented 7 years ago

+1 Supporting OGC filter syntax in addition to the datasource syntax will be a plus

rldhont commented 7 years ago

+1 This will also need an enhancement in QgsVectorLayer or QgsMapSettings to defined filter based on expression for rendering.

haubourg commented 6 years ago

ping @pblottiere too

nboisteault commented 4 years ago

@pvalsecc Thank you for this feature. Does filter accept GML version 3?