Home | Docs | Issue Tracker | FAQ | Download | |
Date: | 2008/06/25 |
---|---|
Author: | Yewondwossen Assefa |
Contact: | assefa at dmsolutions.ca |
Status: | Adopted |
Version: | MapServer 5.2 |
Id: | $Id$ |
When WMS and SLD support was added in MapServer few years back, one of features that was not integrated was the ability to specify named styles through WMS GetMap request using the STYLES parameter or through the <NamedStyle> parameter in an SLD document.
Using named styles, the WMS client has the ability to render a specified layer using styles predefined by the WMS server.
Example of this would be:
http://..../mapserv.cgi?Request=GetMap&....&LAYERS=Rivers,Roads,Houses&STYLES=CenterLine,CenterLine,Outline
<StyledLayerDescriptorversion="1.0.0">
<NamedLayer><Name>Roads</Name>
<NamedStyle>
<Name>Casing</Name>
</NamedStyle>
<NamedStyle>
<Name>CenterLine</Name>
</NamedStyle>
</NamedLayer>
</StyledLayerDescriptor>
The main reason this functionality is not yet supported is that It is not currently possible to defined in MapServer several mutually exclusive ‘styles’ on a layer The intention of this RFC is to introduce a simple mechanism that would allow MapServer to define mutually exclusive ‘Styles’. This would then allow for MapServer to advertise and support named styles through the WMS interface
The MapServer architecture (layer. class, styles) does not fit well the SLD model where it assumes that you can define mutually exclusive styles on a layer and be able to switch between them.
One possible solution which is reasonably non disruptive would be to introduce the concept of group names at the class object level and have at a layer level a parameter that can be used to specify the classes to use. Something like this is what is proposed:
LAYER
...
CLASSGROUP "group1"
...
CLASS
NAME "name1"
GROUP "group1"
...
END
CLASS
NAME "name2"
GROUP "group2"
...
END
CLASS
NAME "name3"
GROUP "group1"
...
END
...
<Style>
<Name>group1</Name>
<Title>group1</Title>
<LegendURL width="20" height="10">
<Format>image/png</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://127.0.0.1/cgi-bin/mapserv.exe?map=f:/msapps/test.map&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=mylayer&format=image/png&STYLES=group1"/>
</LegendURL>
</Style>
maplexer.l
mapserver.h
mapfile.h
mapfile.c
mapogcsld.c
mapwms.c
maplegend.c
mapcopy.c
php_mapscript.c
Need to update set function (at least in the php MapScript) to set the two new parameters at the layer and class level. Need to check if there is anything to be done for swig MapScript.
All work described in this RFC will provide optional capabilities to MapServer and no backward compatibility issues are expected.
SLD, WMS Server, and Mapfile documents will be upgraded.
Addition of a test in msauto to validate the support of names STYLES parameter through a GetMap request
+1: Assefa, TomK, FrankW +0, DanielM, SteveW