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

Dan Keith bud at cirl.uoregon.edu
Wed Mar 27 14:39:50 PST 2002


Hi Michel,

I have a simple layer definition that illustrates the problem quite 
nicely. It doesn't require any shapefiles, just paste it into an 
existing mapfile. If the bug exists, this layer definition will 
dramatically illustrate it.

At this point, it is looking like a freetype problem. I am using 
MacOSX with freetype 2.0.5 and experiencing the bug (my text looks 
very similar to yours). When I run the same test under Debian Linux, 
the text looks fine. I'm glad to hear that you are experiencing the 
same problems. Perhaps there is a particular version of freetype that 
is buggy.

Nnote that the linux version that I have that is working is 2.0.9, 
whereas the buggy macosx version is 2.0.5. I'd be curious as to which 
version of freetype you are using.



LAYER
      NAME            Labelling
      TYPE            LINE
      STATUS          ON
      TRANSFORM       FALSE

      CLASS
          NAME    'label'
          COLOR   255 0 0
          SIZE    2
          LABEL
              COLOR               255 0 0
              SIZE                8
              OFFSET              0 8
              BUFFER              8
              TYPE                TRUETYPE
              FONT                Arial
              ANGLE               AUTO
          END
      END

      FEATURE
          TEXT "------------ At 45 degrees, a slight divergence ------------"
          POINTS 20 160 170 10 END
      END

      FEATURE
          TEXT "------------ At less than 45 degrees, more divergence 
------------"
          POINTS 30 200 280 160 END
      END

      FEATURE
          TEXT "------------ Why is this text bent? ------------"
          POINTS 80 280 280 210 END
      END
END


At 3:24 PM -0300 3/27/02, Michel M. dos Santos wrote:
>
>	Steve,
>
>	I have been occupied with others tasks and not reply your 
>last mail for me
>(below), but my problem still continue.
>
>	I think that  Dan Keith has same problem.
>
>	I put 2 images for you see:
>
>	http://creedence.org/imagens/map.png  ( done by Mapscript 
>PHP, Mapserver
>3.5, linux kernel 2.4.5 , glibc 2.2.3, apache 1.3.22) and
>	http://creedence.org/imagens/arc.png    ( done by ArcExplorer 2.0 for
>windows milenium,  only for comparision).
>
>	Boot images are done with same data (shapefile e dbf file).
>
>	The shapfile is type LINE and the labels doesn't follow the symbol in
>mapserver.
>
>             LABEL
>                 ANGLE AUTO
>                 BUFFER 2
>                 COLOR 0 0 0
>                 FONT "arial"
>                 MAXSIZE 16
>                 MINDISTANCE 300
>                 MINSIZE 6
>                 PARTIALS TRUE
>                 POSITION CC
>                 SIZE 10
>                 TYPE TRUETYPE
>             END
>
>
>	This is a big problem for me.  My client likes the final 
>result with my job
>with mapserver , but doesn't  like these labels wrongs.
>
>	Thanks a lot,
>
>--
>[]'s
>Michel M. dos Santos
>
>-------------------------8<-------------------------------------
>
>Re: [mapserver-users] symbol of the streets
>Data: Tue, 12 Mar 2002 15:27:14 -0600
>De: "Steve Lime" <steve.lime at dnr.state.mn.us>
>Para: <frank.koormann at intevation.de>, <michel at omnisystem.com.br>
>Cópia: <mapserver-users at lists.gis.umn.edu>
>
>
>Auto rotation of labels requires lines. Are the lines being labeled also
>being displayed? Doesn't
>seem like it to me. If you actually draw those what does the map look
>like?
>
>Steve
>
>Stephen Lime
>Data & Applications Manager
>
>------------------------8<-------------------------------------
>
>Em Seg 25 Mar 2002 18:10, Steve Lime escreveu:
>>  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