[Mapserver-users] label placement, how shape's center is determined

richard hornsby rhornsby at io.osuedc.org
Fri Feb 7 14:11:11 PST 2003


I'm looking through the maplabel.c file, trying to understand better how
the placement of labels within a shape is determined.

>From my tiny bit of C background, and from observing output, it seems like
mapserv is drawing a rectangle big enough to surround the shape, and then
finding the center of that rectangle.  Please correct me if this is not
how it works.

Using several different position switches (CL, CC, AUTO, etc) in the label
declaration of the map file doesn't seem to make any significant
difference in how labels are placed in oddly shaped polygons, such as
those for state senate districts.

Going with the above assumptions, my thought is that finding the largest
possible square (or rectangular) area *within* the shape would seem to be
a "better" (if slower, and far more difficult) method of determining where
to place the label...?  Conceptually this makes sense to me, but certainly
not in terms of how it would be done syntacially in C.

-rj
osuedc systems



--
Information Center, n.:
        A room staffed by professional computer people whose job it is to
        tell you why you cannot have the information you require.

rj hornsby . systems engineer . www.osuedc.org
human and community resource development
p 614 688 8761 . f 614 688 8762





More information about the MapServer-users mailing list