[mapserver-users] ANGLE AUTO labels with TRUETYPE and LINE features. The text isdisplayed wrong.

Steve Lime steve.lime at dnr.state.mn.us
Mon Mar 25 13:10:39 PST 2002


Hmmmm... Assuming that MapServer calculates the right angle for a single
segment it could be a data problem. Could you share some? If a road is
segmented into many small pieces then MapServer chooses a single one to
represent the line. If that segment is much smaller than the displayed
text then even a small variation between segments *could* cause the
error. Could also be an error in MapServer. Having the data sample would
help resolve that question.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> Dan Keith <bud at otsys.com> 03/22/02 02:50 AM >>>
I have a shape file containing road definitions in the form of line 
segments. Using mapserver, I can draw the layer and its segments and 
the labels for the highway segments. So I have no problems with my 
shapefile and its interaction with mapserver.

My problem is in the appearance of the angled labels with respect to 
the segments that they are labelling. Note that I am using the 
mapserver feature that automatically calculates the angle (as opposed 
to obtaining it from the shapefile's .dbf).

Using the ANGLE AUTO feature on the labels, I can get the label 
angles to closely match the angle of the segment, but not quite. 
Usually, there is a 10-degree difference in the two angles, which 
causes the label to drift away or towards the road segment.

I'm wondering if others have noticed this behavior, and whether this 
is something that is fixable (or controllable). I've tried various 
combinations of the POSITION and OFFSET fields of the LABEL. So far, 
the best I've come up with is a label positioned above the road 
segment with a small amount of space between the label and the road. 
I use:

         LABEL
             TYPE                TRUETYPE
             ANTIALIAS           TRUE
             FONT                Arial
             ANGLE               AUTO
             POSITION            AUTO
             COLOR               0 0 0
             SIZE                8
         END

I was hoping someone out there could tell me whether mapserver can be 
made to behave better.

thanks,
dan keith (bud at otsys.com)



-- 
Dan "Bud" Keith - bud at otsys.com




More information about the MapServer-users mailing list