[mapserver-users] SLD with TextSymbolizer

Michael Schulz mschulz at webgis.de
Tue Sep 15 11:04:47 EDT 2009


Hi,

actually, I think the sld specs say that the label property can be of
mixed content and thus should e.g. allow for static text and variable
property values. So if you want to have a static text "V" id should
suffice to put that as it is in the label-tag. Values that have
variable content obtained from a DB-field should be enclosed with
<ogc:PropertyValue>. An example from the ogc spec:

<Label>This is city "<ogc:PropertyName>NAME</ogc:PropertyName>"
of state <ogc:PropertyName>STATE</ogc:PropertyName></Label>

I had these problems too with older mapserver versions (< 5.x), but
thought that recent versions handle this correctly. Especially the
case of the example should work. Can you try that, i.e. have a static
text mixed with a ogc:PropertyValue?

Cheers, Michael


2009/9/15 Guillaume Sueur <no-reply at neogeo-online.net>:
>
> Hi Daniel,
>
> Label is supposed to enclise the name of a field. Here is a complete
> working example of text symbolizer :
> <TextSymbolizer>
>        <Label>id_field</Label>
>        <LabelPlacement>
>                <PointPlacement>
>                        <Displacement>
>                                <DisplacementX/>
>                                <DisplacementY>5</DisplacementY>
>                        </Displacement>
>                </PointPlacement>
>        </LabelPlacement>
>        <Font>
>                <CssParameter name="font-family">VERDANA</CssParameter>
>                <CssParameter name="font-style">bold</CssParameter>
>                <CssParameter name="font-size">16</CssParameter>
>        </Font>
>        <Fill>
>                <CssParameter name="fill">#000000</CssParameter>
>        </Fill>
>        <Halo>
>                <Radius>3</Radius>
>                <Fill><CssParameter name="fill">#FFFFFF</CssParameter></Fill>
>        </Halo>
> </TextSymbolizer>
>
> Hope that helps
>
> Guillaume
>
>
> Daniel Degasperi a écrit :
>> Hi,
>>
>> I've some problems using the TextSymbolizer in my SLD-File (see
>> Attachment route_sld.xml), specially with the following part, which will
>> generate this error: column Literal does not exists. (see Attachment
>> wms_error.png for further details)
>>
>> <ogc:Label><ogc:Literal>V</ogc:Literal></ogc:Label>
>>
>> Is this problem related to MapServer or MapServer does not support
>> SLD-Labels?
>>
>> I've tested this with MapServer 5.2.2 and 5.4.2.
>>
>> Best regards,
>> Daniel Degasperi
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Besuchen Sie uns auf der INTERGEO 2009: 22.09. - 24.09.2009 in Karlsruhe;
Halle 1, Stand 1.417
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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