[mapserver-users] SLD with Mapserver 5.4.2

Michael Schulz mschulz at webgis.de
Fri Jul 31 07:13:38 EDT 2009


Hi Andrea,

mapserver uses sld in "library" mode, meaning that if for a certain
layer of the mapfile an sld symbolization is provided it takes
precedence over the mapfile symbolization. If for another layer no sld
id provided, then the mapfile symbolization is used. Thus, As far as I
know you can only "replace" the symbolization of a complete layer and
not add styling in a sense of taking the labelling definitions from
the mapfile and the fill-color from the sld for one layer.

It may nevertheless be that some definitions regarding symbolization
are mixed, e.g. the transparency settings of a layer is kept when
applying an sld (at least this was the case for older versions).

When you really want to add something to the symbolization, a possible
approach would be to use the getstyle request to obtain mapserver's
sld-representation of the current layer styling, then you could add or
modify that and sent it back modified for a getmap request.

Cheers, Michael

2009/7/31 Andrea Dessì <nkjoep at gmail.com>:
> Hi Michael,
>
> Thank you for your answer :)
>
> Now SLD is working i had a mistake with names references.
>
> I have just another question: how is possible to "add" a style
> using SLD without overriding the whole server style?
>
> I explain what i want to do: I have a map served by MapServer, so a
> mapfile with layers and styles. I want to add a style with "new"
> characteristics (could be outline or overriding just the color of the text).
>
> Thanks,
> Andrea
>
>
>
> 2009/7/30 Michael Schulz <mschulz at webgis.de>
>>
>> Hi Andrea,
>>
>> to use SLD you won't need very special mapfile configuration. You
>> should pay attention to setting the imgpath parameter of the web
>> section correctly, i.e. accessible and writable by mapserver-cgi,
>> since the sld's are stored there temporarily while/after downloading
>> them from the specified URL. I am not aware of any other special
>> configuration, but very helpful are the debugging outputs, that you
>> can enable with the keyword DEBUG "on" at map or layer level. I find
>> it most convenient to specify an errorfile path via CONFIG
>> "MS_ERRORFILE" "/ms4w/tmp/ms_error.txt" at map level.
>>
>> Be sure to set the SLD's NamedLayer Name tag value exactly the same as
>> your mapfile's layer name you want to style.
>>
>> Cheers, Michael
>>
>>
>> 2009/7/30 Andrea Dessì <nkjoep at gmail.com>:
>> > Hi,
>> >
>> > i've started using Mapserver few days ago and i cannot apply SLD styles.
>> >
>> > i'm using  MapServer version 5.4.2
>> > OUTPUT=GIF OUTPUT=PNG
>> > OUTPUT=JPEG OUTPUT=WBMP
>> > OUTPUT=SVG
>> > SUPPORTS=PROJ
>> > SUPPORTS=AGG
>> > SUPPORTS=FREETYPE
>> > SUPPORTS=ICONV
>> > SUPPORTS=WMS_SERVER
>> > SUPPORTS=WMS_CLIENT
>> > SUPPORTS=WFS_SERVER
>> > SUPPORTS=WFS_CLIENT
>> > SUPPORTS=WCS_SERVER
>> > SUPPORTS=FASTCGI
>> > SUPPORTS=THREADS
>> > SUPPORTS=GEOS
>> > INPUT=EPPL7
>> > INPUT=POSTGIS
>> > INPUT=OGR
>> > INPUT=GDAL
>> > INPUT=SHAPEFILE
>> >
>> > under Ubuntu 9.04.
>> >
>> > I want to user mapserver as WMS Server and the apply SLD styles on the
>> > fly... the common query is:
>> > http://localhost/cgi-bin/wms?SERVICE=WMS&
>> > VERSION=1.1.1&
>> > REQUEST=GetMap&
>> > BBOX=-74.012362,40.752314,-73.948216,40.791051&
>> > SRS=EPSG:4326&
>> > WIDTH=500&
>> > HEIGHT=500&
>> > LAYERS=myground,myroads&
>> > FORMAT=image/gif&
>> > TRANSPARENT=TRUE&
>> > SLD=http://localhost/mysld.xml
>> >
>> > But sld is not applying.
>> >
>> > The question is: there are specific parameters for using SLD in mapfile?
>> > I'm feeling a bit confused about this.
>> >
>> > Thank You,
>> > --
>> > Andrea
>> >
>> > _______________________________________________
>> > mapserver-users mailing list
>> > mapserver-users at lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
>> >
>>
>>
>>
>> --
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Aufwind durch Wissen!
>>
>> Qualifizierte Open Source Schulungen bei der
>> http://www.foss-akademie.de/
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> -----------------------------------------------------------
>> Michael Schulz
>> mschulz at webgis.de
>>
>> in medias res
>> Gesellschaft für Informationstechnologie mbH
>>
>> +++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++
>>
>> Schwimmbadstraße 2
>> D-79100  Freiburg i. Br.
>>
>> Tel:  +49 (0)761 705798-102
>> Tel:  +49 (0)761 705798-0
>> Fax: +49 (0)761 705798-09
>>
>> +++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++
>>
>> http://www.webgis.de / http://www.zopecms.de
>> --------------------------------------------------------------
>> Geschäftsführer: Stefan Giese, Dr. Christof Lindenbeck
>> Eingetragen im Handelsregister HRB 5930 beim Amtsgericht Freiburg
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Aufwind durch Wissen!

Qualifizierte Open Source Schulungen bei der
http://www.foss-akademie.de/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-----------------------------------------------------------
Michael Schulz
mschulz at webgis.de

in medias res
Gesellschaft für Informationstechnologie mbH

+++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++

Schwimmbadstraße 2
D-79100  Freiburg i. Br.

Tel:  +49 (0)761 705798-102
Tel:  +49 (0)761 705798-0
Fax: +49 (0)761 705798-09

+++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++

http://www.webgis.de / http://www.zopecms.de
--------------------------------------------------------------
Geschäftsführer: Stefan Giese, Dr. Christof Lindenbeck
Eingetragen im Handelsregister HRB 5930 beim Amtsgericht Freiburg


More information about the mapserver-users mailing list