[Mapserver-users] How to center labels in land parcels displayed by line layers?

Frieso ter Haseborg ter-haseborg at sf-datentechnik.de
Wed Jul 7 07:27:43 EDT 2004


Hi,

>Why not change the layer type to polygon?
This had no results on my first tries and I must have lost track somehow. But shame on me, you're absolutely right, it works great with 'TPYE POLYGON' and - that's the 2nd part of the key - 'POSITION CC'. I left POSITION on AUTO which returns the labels back to the middle of the line as mentioned in the docs.

So for the record, for those who run into the same - here comes the right layer definition:
LAYER
   TYPE POLYGON        # <= !!!
   ...
   CLASS
      ...
      LABEL
      ...
         POSITION CC   # <= !!!
      END
   END
END

>the attached ms.gif was empty?
Actually the gif wasn't an GIF at all (wrong format => PSP), I reposted it a 2nd time half'n hour ago.

Thanx a lot!
Frieso


> -----Original Message-----
> From: Michael Schulz [mailto:mschulz at webgis.de]
> Sent: Wednesday, July 07, 2004 12:48 PM
> To: Frieso ter Haseborg
> Cc: mapserver-users at lists.gis.umn.edu
> Subject: Re: [Mapserver-users] How to center labels in land parcels
> displayed by line layers?
> 
> 
> Hi,
> 
> automatic positioning of labels centered in a polygon works 
> with mapserver for layers of type 
> polygon only. Mapserver won't position a line label centered 
> in pseudo-polygon (other than by 
> chance). Why not change the layer type to polygon?
> 
> Actually, mapserver will by default label every line segment 
> (cit. from docs: "Lines are labeled at 
> the middle of the longest arc in the visible portion of the 
> line"), but by providing the MINDISTANCE 
> parameter, you can control the behaviour of duplicate labels.
> 
> BTW, is mapserver not drawing anything? Since the attached 
> ms.gif was empty?
> 
> Cheers, Michael
> 
> 
> Frieso ter Haseborg schrieb:
> 
> > Hi,
> > 
> > I'm trying to annotate a layer showing land parcels. The 
> layer is a shape of type LINE. How do I center the labels in 
> line layers using MS?
> > 
> > MS seems to center the label in the middle of the first 
> line drawn, but not in the middle of the polygon created. 
> What I receive is shown in the attached 'ms.gif'
> > 
> > What I want to achieve is displayed in the 'esri-ae.gif' 
> created with ESRI ArcExplorer (which does the centering by default). 
> > 
> > The label definition used:
> > LABEL
> >    FORCE TRUE
> >    TYPE TRUETYPE
> >    FONT ARIAL
> >    SIZE 8
> >    BACKGROUNDCOLOR 255 255 231
> >    POSITION AUTO
> > END
> > 
> > Is there any way to achieve the same results with MS?
> > 
> > Any hint would be appreciated.
> > 
> > TIA,
> >  
> > Frieso ter Haseborg
> > - Software Development - 
> >  
> > --
> > 
> > -------------------------------------------------- 
> > S&F Datentechnik GmbH&Co.KG 
> > Reimersstr. 41b 
> > 26789 Leer, Germany
> > 
> > 
> > 
> > 
> --------------------------------------------------------------
> ----------
> > 
> > 
> > 
> --------------------------------------------------------------
> ----------
> > 
> 
> -- 
> -----------------------------------------------------------
> Michael Schulz                                in medias res
> Dipl.-Geologe                              Gesellschaft für
>                                  Informationstechnologie mbH
>                                       In den Weihermatten 66
> 		                             79108 Freiburg
>                                       0761 55695-95 (Fax 96)
> mschulz at webgis.de              www.webgis.de/www.zopecms.de
> 
> 




More information about the mapserver-users mailing list