Ticket #383 (new enhancement)
Add Filter extension to WMS server
| Reported by: | rcoup | Owned by: | rcoup |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.8.0 |
| Component: | Core Library | Version: | SVN Trunk |
| Severity: | Normal | Keywords: | wms |
| Cc: | Patch Needs Improvement: | no | |
| Needs Docmentation: | no | Has Patch?: | no |
| Design Decision Needed: | yes |
Description
Proposal is to add a CQL_FILTER parameter to the WMS server, using the same syntax as the GeoServer extension.
When the CQL_FILTER parameter is used, either a single filter is provided (that will be applied to all layers) or a list or filters, with the same number of filters as the layers in the WMS request.
Basically, write a parser for the filter syntax (as much as is supported by Mapnik's filters anyway), then when CQL_FILTER= is specified in a request:
- iterate through the styles & rules for each layer
- parse the cql-filter
- AND it with any existing filter
- draw the map as normal.
Problems:
- there's no existing way to add filters together, but the parser does it so it can't be that hard :)
- how do we handle the else-filter? Since if i specify (encoded)
CQL_FILTER=LANAME="East River"
the the else clause will match everything that's NOT in the filter, which is not the desired behaviour. - matching the CQL syntax to Mapnik's filter behaviour
Another option would be to allow filtering at a Layer level as well as the Rule level. In that case all WMS filters would be applied to layers, which would have precedence over Rule filters. The syntax would be the same (layer.filter=Filter(...), and <Layer><Filter>...</Filter>...</Layer>). Presumably we'd have to AND any WMS filters with existing layer filters as above.
Official CQL spec is part of the OGC OpenGIS Catalogue Service Implementation Specification (Section 6.2, pg 27).
