Read queryLayers metadata for WMS data source #5408
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
With the introduction of #5250 (Support layer group filtering), a WMS data source that use a "group" as WMS layer can have multiple inner WFS layers, each of which get filtered properly.
However, an issue occurs when we try to query such a data source: we get duplicate records. More precisely, we have 1 set or records per WFS layer. For example, in a group "hotel_filter", which groups 2 layers: "hotel" and "hotel_layer", we have 2 sets of results, one for "hotel" and one for "hotel_layer".
We should have only one.
Assumption
It is assumed that a WMS data source that uses a group layer should only have ONE of its inner WFS layer to return data when queries are issued.It's okay to have multiple inner layers within a group that can return data.It is assumed that all WFS layer within a group can be filtered through the WMS layer in the map.
Fix
This patch implements a way to only have 1 set of records returned for a WMS data source that use a group: by using the
queryLayers
metadata.This metadata was already introduced for WMTS, and used to be only used by WMTS. Now, if defined in a WMS data source, it means that only the layers defined in there should be queried.
That metadata is read in the GMF data source manager, and is translated as a new property of the
GmfLayerChildLayer
object:getData
. That new property is not an official property supported by the Themes service, but is rather a calculated value to have a nice way to know at the "child layer level" if it is queryable and can have data fetched (i.e. if it can be used to issue requests). That property is assumed to betrue
, if not defined.