[mapserver-users] labeling a graticule
Stephen Lime
steve.lime at dnr.state.mn.us
Tue Jan 15 12:32:09 PST 2002
One idea would be to do a bit of pre processing of the data to affect the order of the segments in the file. For you might bust the graticule into two files, one for horizontal and one for vertical segments. Then add a new attribute called AVG or something and populate it with the average x or y coordinate (depending on orientation). Now sort the two shapefiles on that attribute, this will order the shapefile left to right and top to bottom (or whichever direction you wish). Finally append them together (a quick mapscript script would work). Because of the way MapServer builds its label cache the effect (I think) would be to concentrate labels along an edge of the map. Since your labels are popped into the cache say left to right then the rightmost label would always be displayed by using the label MINDISTANCE and MINFEATURESIZE options. Might be worth a try and would just require a couple of short mapscript scripts to build the data.
As for a graticule object, I've thought about such for quite a while but have never got around to adding it. Could you add it to bugzilla so we don't loose the idea?
Steve
Stephen Lime
Data & Applications Manager
Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> "Brent Fraser" <bfraser at geoanalytic.com> 01/11/02 02:11PM >>>
Steve (and others),
Any thoughts on how to get perimeter labels for
a graticule?
I'd like the labels to be at the perimeter (just inside)
of the map graphic just above (or beside) the line
of latitude or longitude. Right now they tend to be
scattered through out the map (see attached gif).
I've got a shapefile with line segments and the value
of the lat/lon line as an attribute as well as a "level"
attribute so the interval will change with the scale.
Here's the portion of my map file:
LABEL
COLOR 255 255 0
TYPE TRUETYPE
FONT arialbd
SIZE 12
POSITION UL
ANGLE AUTO
OFFSET 4 4
PARTIALS FALSE
END # Label
Of course what I'd really want is a native MapServer
Graticule object with lots of options for line drawing
and labelling on the outside perimeter of the map
graphic. Maybe v3.6?
Thanks!
Brent Fraser
bfraser at geoanalytic.com
GeoAnalytic Inc.
#300 , 700 - 4th Avenue SW Calgary, AB
Canada T2P 3J4
Tel: (403)213-2700 Fax: (403)213-2707
www.geoanalytic.com
More information about the MapServer-users
mailing list