In response to GetMap, GetFeatureInfo with the format_options=mapmlfeatures:true
parameter, add ability to recursively 'de-layer' a layergroup into a text/mapml document composed of its composite layers as features and tiles
#74
Labels
help wanted
Extra attention is needed
Milestone
Background
A LayerGroup in GeoServer is composed of one or more Layer or LayerGroup objects, ordered from bottom to top of the rendering stack i.e. in painter's model order. Because a LayerGroup is a composition of layers, per the previous statement, it's possible that there are many levels of nesting within a LayerGroup's definition. Despite this nesting, at the end of processing a WMS GetMap or GetFeatureInfo for such a layer, it must be de-nested into a linear set of layers to be rendered, each one on top of all the previous layers, in the painter's model.
A MapML document that requests the above result as a bitmapped image doesn't have to concern itself with the recursive rendering of the component layers, it only has to render the bitmapped image. On the other hand, if the de-nested layers were rendered as ordered sets of <map-feature> vectors and <map-tile> elements, it would be possible to render that content on the <mapml-viewer> client or in the MapML preview.
Currently in GeoServer, a GetMap for
format=text/mapml
can indeed support a request for one or more layer groups among the layers that are requested via thelayers=layer1,layer2,layer3
parameter i.e. any one or all oflayer1
,layer2
orlayer3
can be a LayerGroup. When this occurs (that is, any multi-layer request where the global "Use Tiles" setting is set to use a single map-extent), GeoServer MapML extension "falls back" to processing the request via a GetMap-style client for images (<map-link rel="image"...>). Processing a single-layer request in which the layer is a LayerGroup is a similar process to processing a multi-layer request in general. This issue, together with issues #73 and #72 will enable vector-based +/- tile MapML responses for a layer group or multi-layer GetMap / GetFeatureInfo requests, i.e. true "vector tiles" potentially containing data from more than a single layer. This issue focuses on LayerGroup processing.Aside: The MapML language has a <map-tile> element that is like a "square feature", in which the network source of the tile image is pointed to by the
src
attribute, and the placement of the tile is specified by itsrow
,col
andzoom
attributes. We need to use the <map-tile> element in this requirement to support the processing of non-vector-capable layers in GeoServer in the context of GetMap / GetFeature requests for layer groups that contain such layers.The requirement outlined in this issue is to enable a request for a single LayerGroup to be serialized according to the passed
mapmlusefeatures
,mapmlusetiles
,mapmlmultiextent
token values for theformat_options
GeoServer WMS parameter, regardless of its inclusion of non-vector-capable layers.The implementation of this requirement will make it possible to render the component layers of any LayerGroup as though it was a simple vector-capable GeoServer Layer, as MapML <map-feature> +/- <map-tile> elements for each of the nested layers, rendered as sets of adjacent elements, in painter's model order in the response document.
The first requirement would be to add a "Use Features" checkbox to the LayerGroup Publishing tab's MapML section, right below the currently implemented "Use Tiles" checkbox:
This interface:
should be updated to become this:
(just as that panel has for the Layer Publishing tab currently).
Building upon previous requirements
To summarize #73, the user interface checkbox settings are used to dictate the URLs used (with the associated
mapmlusetiles
,mapmlusefeatures
,mapmlmultiextent
format_options values) in the GeoServer preview, but they may be set (dynamically) at runtime by a client in theformat_options
value that is passed via the GetMap / GetFeatureInfo parameter. In other words, the user interface checkboxes affect the preview that is generated, but do not diminish or affect the client's ability to select a different option at runtime. Put another way, the geoserver user interface settings are ignored when processing requests dynamically, relying instead on theformat_options
vendor parameter.In sum:
mapmlmultiextent
tells GeoServer if individual layers referenced in thelayers
parameter list should be represented as individual elements, or if they may all be piled into a single (pair of) <map-link rel="tile">GetMap and GetFeatureInfo URL template(s) (depending on the queryable nature of the layers).mapmlusetiles
tells the extension what the configuration of the <map-input>s in the <map-extent>(s) should be: true means that the inputs should be created to support <map-link rel="tile"> GetMap and GetFeatureInfo URL templates.mapmlusefeatures
tells GeoServer to generate a <map-extent> for which the <map-link>(s) is/are configured to make GetMap / GetFeatureInfo requests for feature data. Whenmapmlusetiles:true
is also set, the generated <map-link rel="tile"> will also contain thetype="text/mapml"
attribute, which tells the client to expect a "leaf-node" MapML document (i.e. a "leaf-node" document does not reference other text/mapml documents in a tree-like structure -- it is the deepest such node in the tree).Statement of Requirement on LayerGroup processing
For this requirement on GeoServer LayerGroup processing, when a GetMap or GetFeatureInfo request is received that includes this layer group in which the
format_options=mapmlfeatures:true
(note it's mapmlfeatures:true here, not mapmlusefeatures:true) request parameter is found, GeoServer MapML extension should render the response "leaf-node" document as (painter's) ordered grouped-by-layer sets of <map-feature>s and/or <map-tile> elements.Below is an example of a MapML document generated in response to a traditional whole-map WMS GetMap request(for a layer group) like
GetMap&format=text/mapml&format_options=mapmlusefeatures:true
- note that the GetMap template below contains themapmlfeatures:true
format option, because the received request contained themapml**use**features:true
parameter value:If a given layer encountered in the recursive expansion of the layergroup's set of layers can NOT be represented as <map-feature> data i.e. is backed by a raster data set, it should be represented as a set of one or more <map-tile> elements within the stack of serialized layer data, ordered by distance of the tile center point from the request envelope/bbox center point.
So long as the non-templated GetMap request used in the <map-tile src="GetMap or GetTile> returns transparent imagery, it may still be useful mixed into the feature information as such, TBD by experimentation with actual data, and it will be up to the GeoServer admin to validate that their layer groups are useful as configured.
e.g. the
tref
URL template above, when variable references were resolved to a WMS GetMap URL, the response might look like the following text/mapml document:Similarly, a layer group may be requested as tiled data, via the
mapmlusetiles:true
format option. In this case the <map-extent> elements generated to represent requests for tiled data for the layer group are configured to either make "tile-shaped" WMS GetMap requests, or if the layer group has previously defined a tile cache and associated gridset, the <map-extent> will be configured to generate WMTS GetTile requests via the embedded <map-link> element. This is possible today, although the configuration is not passed as aformat_option
until #73 is resolved.Once #73 is working, it should now be possible, in response to a GetMap involving a layer group, to generate <map-extent>s and associated child <map-link rel="tile" type="text/mapml" tref="...GetMap / GetTile..."></map-link> which will generate requests for the layer group's content to be serialized as "tile shaped" text/mapml documents, with the appropriately clipped / spanned+styled and layer-ordered groups of <map-feature> elements to represent the layer group's constituent layers, with non-vector capable layers in the group represented by non-templated <map-tile> elements coded to the calculated zoom level (calculated based on the scale which is calculated from either the bbox of the GetMap, or the tile matrix level from the GetTile.
The text was updated successfully, but these errors were encountered: