Skip to content

WFS Filters based on WFS indexing with SOLR

Jesse Eichar edited this page Aug 4, 2015 · 18 revisions
Date August 03 2015 Contacts Florent Gravin
Status Release Future
Resources Available Ticket #
Source code
Funding Ifremer

Overview

We want to offer the mapviewer user a way to filter WFS data. All available fields and operation to filter on will be retrieved using WFS describeFeatureType. For more advanced filtering, inspired by facets, we need to get all the WFS datas from the layer to build better filters. For this part, we propose to index WFS content in SOLR, and build facets from this index.

After the filters are designed by the user, a server part will generate an SLD file and send it to all getMap requests to only display features we filtered.

Note: One desired feature of SLD generation is to base the style on SLD style used by the WMS server. This means that the SLD needs to be downloaded from the WMS server, parsed and updated with the filters. For example consider a SLD that styles all highways with one style and all other road types with another style. When we generate a style we want to download the style from the WMS and modify it by adding user filter to each rule.

SLD Generation

  • We need to retrieve active SLD content.
  • create SLD rules for filters
  • merge custom rules in active SLD

Some code has already been implemented for geOrchestra project. This code generates SLD from styling rules definition. https://github.com/georchestra/georchestra/tree/14.12/mapfishapp/src/main/java/org/georchestra/mapfishapp/ws/classif

Accurate SLD Generation can only be done if the WMS supports the optional GetStyles request. If the request is not supported then the first version will simply generate a simple style for the geometry type.

The rough algorithm will be as follows:

  • The user will submit the desired filters
  • The server will check capabilities of the various WMS versions of the WMS Server to try and find a version that supports GetStyles. (GetStyles is introduced at version 1.1.0)
  • If GetStyles is not supported:
  • Geometry type will be retrieved from SOLR or DescribeFeatureType (TBD)
  • A Base SLD will be chose based on the Geometry type
  • If GetStyles is supported
  • GetStyles will be used to download the SLD from the WMS Server
  • The downloaded SLD will be used as the Base SLD
  • Each rule in the SLD will be updated by modifying the filter of the rule:
  • If a rule does not have a filter then the filter will be set on the rule
  • If a rule has a filter then the user filter will be ANDed with the rule filter

WFS indexing

We want to create a UI for creating advanced filters that is also easy for the user to use. The design is inspired by facets.

In order to do this we need to get all features from the layer. This process can be very long. Also, retrieving it client side and processing datas to built facets can be complex.

So we want here to use SOLR to index WFS and use SOLR request to build facets on the fly. Also, the filter generation will be very fast, as data are already indexed.

The point here is when to reindex ?

  • add a button to request the index of the layer
  • add a CRON that index every night
  • add admin ui to manage WFS indexing

Related work

Proposal Type:

  • Type: Widget
  • Module: Community

Voting History

  • Vote Proposed:

Participants

  • Florent Gravin
  • Jesse Eichar
Clone this wiki locally