Skip to content

Commit ec04d97

Browse files
authored
Add documentation for MapServer/MapServer#7663 (#1116)
1 parent 52dae9e commit ec04d97

1 file changed

Lines changed: 44 additions & 3 deletions

File tree

‎en/ogc/sld.txt‎

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,51 @@ placed at the layer level in a MapServer Mapfile:
678678
GetStyles Requests
679679
------------------
680680

681-
As part of the WMS implementation, MapServer supports ``GetStyles`` requests, which return an SLD document describing the styles available for a given layer.
682-
An example of a GetStyles request is https://demo.mapserver.org/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetStyles&LAYERS=country_bounds.
681+
As part of the WMS implementation, MapServer supports ``GetStyles`` requests,
682+
which return an SLD document describing the styles available for one or more
683+
layers. An example GetStyles request is
684+
https://demo.mapserver.org/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetStyles&LAYERS=country_bounds
683685

684-
This allows Mapfile styling to be used by other clients that support SLD, and can be used to style vector data to match the WMS server's style.
686+
This allows Mapfile styling to be used by other clients that support SLD, for
687+
example to style vector data to match the WMS server's rendering.
688+
689+
The SLD 1.0.0 specification extends WMS 1.1.x with the GetStyles request, as
690+
documented in section 13.1 of https://docs.ogc.org/is/02-070/02-070.pdf.
691+
SLD 1.1.0, used with WMS 1.3.0, no longer defines GetStyles, but MapServer
692+
supports it for all WMS versions (advertised as ``ms:GetStyles`` in WMS 1.3.0
693+
capabilities).
694+
695+
The following GetStyles parameters are supported:
696+
697+
**VERSION=version:** Request version (required)
698+
699+
**REQUEST=GetStyles:** Request name (required)
700+
701+
**LAYERS=layer_list:** Comma-separated list of named layers or groups for
702+
which to retrieve style descriptions (required)
703+
704+
**STYLES=style_list:** Comma-separated list of one style per layer in
705+
``LAYERS``, matched by position, used to limit which styles are returned
706+
(optional, vendor-specific, added in MapServer 8.8).
707+
708+
- Style names are Mapfile CLASS ``GROUP`` names, and are compared
709+
case-insensitively.
710+
- If ``STYLES`` is omitted or empty (``STYLES=``), or an entry is empty or
711+
``default``, all styles are returned for that layer. ``default`` is
712+
reserved, so a CLASS ``GROUP`` named ``default`` cannot be selected.
713+
- When a style is selected, classes without a ``GROUP`` are not included,
714+
matching how GetMap renders the layer with that style.
715+
- An unknown style, or a list whose length does not match ``LAYERS``,
716+
returns a ``StyleNotDefined`` exception.
717+
718+
.. note::
719+
720+
The **SLDVER** parameter from the SLD 1.0.0 specification is not supported.
721+
The SLD version is determined by the WMS version: WMS 1.0.0 to 1.1.1 return
722+
SLD 1.0.0, and WMS 1.3.0 returns SLD 1.1.0.
723+
724+
The response type is ``application/vnd.ogc.sld+xml`` for SLD 1.0.0 and
725+
``text/xml`` for SLD 1.1.0.
685726

686727
The following MapServer style properties are supported when generating SLD:
687728

0 commit comments

Comments
 (0)