labeling with SLDs in MapServer

Laura Díaz laura.diaz at IVER.ES
Mon Apr 3 08:04:23 EDT 2006


Hi Bartje,
thanks for your answer.. i made the SLD work just changing
<Label>
<ogc:PropertyName>HOJAS10_ID 
</ogc:PropertyName>
</Label> 
for
<Label>
HOJAS10_ID 
</Label>
in the Label tag, it appears in the documentation in that way, but it does not work, at 
least in the mapserver i use 4.6.1.

> I don't think this is possible (I also briefly checked the source code 
> and all the handlers use OWS_GML2).
> So if you want it, submit an enhancement request for it in bugzilla.

yes, that is a good suggestion, it is a useful functionality
> 
> Btw, what happened to your C reading capabilities :-) ?
don't know... what happened? :-))

regards,
Laura


On 3 Apr 2006 at 7:18, Eijnden, B. van den (Bart) wrote:
> 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.
> ************************************************************************
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060403/ae2e2273/attachment.html


More information about the mapserver-users mailing list