labeling with SLDs in MapServer
Eijnden, B. van den (Bart)
b.vdeijnden at AGI.RWS.MINVENW.NL
Sun Apr 2 22:18:54 PDT 2006
Laura,
this works for us (Name is the layer name, Label is the column name):
<StyledLayerDescriptor version='1.0.0'>
<NamedLayer>
<Name>NL-prov</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<TextSymbolizer>
<Label>OMSCHR</Label>
<Font>
<CssParameter name='font-color'>#000000</CssParameter>
<CssParameter name='font-family'>arial</CssParameter>
<CssParameter name='font-size'>10</CssParameter>
</Font>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Best regards,
Bart
-----Oorspronkelijk bericht-----
Van: UMN MapServer Users List
[mailto:MAPSERVER-USERS at LISTS.UMN.EDU]Namens Bart van den Eijnden
(OSGIS)
Verzonden: zaterdag 1 april 2006 18:38
Aan: MAPSERVER-USERS at LISTS.UMN.EDU
Onderwerp: Re: [UMN_MAPSERVER-USERS] labeling with SLDs in MapServer
Hi Laura,
we use this functionality quite often, but I don't have access to the
intranet Wiki here so I cannot paste an example.
I'll try to do that on Monday.
Best regards,
Bart
Laura Díaz wrote:
> Hi all,
> i am trying to label a layer i have defined in my map file, it is a
> point shapefile layer, the SLD i am using is as follows:
> <StyledLayerDescriptor>
> <NamedLayer>
> <Name>hojas_label</Name>
> <UserStyle>
>
> <Name>default:hojas_label:COD10000</Name>
> <IsDefault>1</IsDefault>
> <FeatureTypeStyle>
> <Rule>
> <Name>labels</Name>
> <TextSymbolizer>
> <Label>
>
<ogc:PropertyName>HOJAS10_ID
> </ogc:PropertyName>
> </Label>
> <Font>
>
<CssParameter
> name="font-family">Serif</CssParameter>
>
<CssParameter
> name="font-style">normal</CssParameter>
>
<CssParameter
> name="font-weight">normal</CssParameter>
>
<CssParameter
> name="font-size">12</CssParameter>
>
<CssParameter
> name="font-color">#000000</CssParameter>
> </Font>
>
> <LabelPlacement>
>
>
<LinePlacement>
>
<PerpendicularOffset>above</PerpendicularOffset>
>
<LineWidth>2.5</LineWidth>
>
<Gap>5</Gap>
>
</LinePlacement>
>
> </LabelPlacement>
> </TextSymbolizer>
> </Rule>
> </FeatureTypeStyle>
> </UserStyle>
> </NamedLayer>
> </StyledLayerDescriptor>
>
> When i request a GetMap with this layer and using this SLD i get the
> message from Mapserver:
> <ServiceExceptionReport version="1.1.1">
> <ServiceException>
> msDrawMap(): Image handling error. Failed to draw layer named
> 'hojas_label'.
> msDBFGetItemIndex(): DBASE file error. Item 'PropertyName' not found.
> </ServiceException>
> </ServiceExceptionReport>
> i´ve checked out the name of the field i want to label, and it is
> correct, actually i did try with all the fields and i have the same
> problem, the layer is good as well because i can visualize it if i
> just don't use this SLD....
> Any ideas?
>
> thanks in advance,
>
> Laura
--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl
Disclaimer
************************************************************************
Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is
uitsluitend bestemd voor de geadresseerde. Als u dit bericht per abuis
hebt ontvangen, wordt u verzocht het te vernietigen en de afzender te
informeren. Wij adviseren u om bij twijfel over de juistheid of de
volledigheid van de mail contact met afzender op te nemen.
This message shall not constitute any rights or obligations.
This message is intended solely for the addressee.
If you have received this message in error, please delete it and
notify the sender immediately. When in doubt whether this message
is correct or complete, please contact the sender.
************************************************************************
More information about the MapServer-users
mailing list