[MapServer-users] SLD styling : how to advertise for WMS/STYLE parameter
Philippe Ghesquiere
philippe.ghesquiere at airbus.com
Thu Nov 6 00:48:44 PST 2025
Hi all,
In our WMS server, I would like to advertise two different styles :
- 1st style based on mapfile definition : 'default'
- 2nd style based on SLD definition : 'sldStyle'
I would like to offer clients a way to select which style they want to
apply, using the WMS "STYLE" parameter :
http://localhost/qgisserverxxx?SERVICE=WMS&REQUEST=GetMap&STYLE=sldStyle
I have tried to use CLASSGROUP, NAME and GROUP keywords. My main file looks
like :
LAYER
...
CLASSGROUP "MyVectors"
...
# Mapfile definition
CLASS
NAME 'Name1'
GROUP 'default'
STYLE
...
END
LABEL
...
END
END # CLASS
#SLD definition
STYLEITEM "sld://SldDefinition.sld
END
My question is :
How do I declare different styling groups within SLD definition ? The CLASS
/ NAME keyword is not appropriate.
In the Mapserver documentation, I found two SLD keywords which could give a
style name :
- <NamedLayer>/<NamedStyle>/<Name>
- <NamedLayer>/<UserStyle>/<se:Name>
Which one should I use ?
<StyledLayerDescriptor version="1.1.0" ...>
<NamedLayer>
<se:Name>landsat</se:Name>
<NamedStyle>
<Name>sldStyle</Name> <====== this one ?
</NamedStyle>
<UserStyle>
<se:Name>sldStyle</se:Name> <==== or this one ?
<se:FeatureTypeStyle>
...
</se:FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Thanks for your help
Philippe
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20251106/c2b85b9b/attachment.htm>
More information about the MapServer-users
mailing list