[mapserver-users] GRID labeling, OK, where are the MapServer GRID guru's??
Bob Basques
Bob.Basques at ci.stpaul.mn.us
Tue Mar 18 15:31:49 PDT 2008
All,
I've (we've) been messing with this GRID object and Labeling while trying to get a USNG grid output with labels
The results are meant to look like the left edge of the attached image. The other three sides are being repositioned by some semi-known process.
Essentially the labels should be:
First two characters are super-scripted, the next two characters are Normal, and the last four are also super-scripted. We've mussed with MapServer code and come up with a method for handling the different styling via a layer in the MAPFILE, using a LABELFORMAT option of NG1(1st 2 chars), NG2 (2nd 2 chars) and NG3 (the last 4 chars). This is set up along the lines of the DDMMSS options for LAT/LON.
You can see that there is something wonky about the justification of the labels. Right now we have space padding in front of and behind the superscripted items, we'll address that separately once we get past this label justification thing.
So the question is, what is the sequence of events for a GRID with labels, being applied to the result? Where in the Code could/should the justifications be eliminated for the GRID writing process (I understand that there needs to be a process for aligning along the edges) so that the regular Labeling parameters, specifically, the OFFSET param, are adhered to.
I've tried all sorts of different combinations of settings to get the right output, and I can only seem to get one edge to display properly.
Furthering this output option a little more, anyone done any work with labeling along the outside of a map image? I could use an option like this for printing for example.
Thanks
bobb
The image results are from using this MapFile:
MAP
NAME 'USNG'
SIZE 800 650
STATUS ON
##IMAGECOLOR 254 254 254
##EXTENT 540000 135000 600000 175000
EXTENT 593133.398829 170094.734526 593893.148973 170712.010326
UNITS FEET
FONTSET ./0000_00/MN_Line_Experiments/fonts/font.list
SYMBOLSET ./0000_00/MN_Line_Experiments/symbols/symbol.list
TRANSPARENT TRUE
IMAGETYPE PNG
WEB
IMAGEPATH "/mnt/VECTOR00/output/"
IMAGEURL "/tmp/"
END
# EPSG:26915
LAYER
NAME "grid"
TYPE LINE
STATUS DEFAULT
CLASS
NAME "Graticule"
COLOR 0 0 0
SYMBOL 'circle'
SIZE 1
END
PROJECTION
"init=epsg:26915"
END
GRID
LABELFORMAT "NG1"
END
END
LAYER
NAME "ng1"
TYPE LINE
STATUS DEFAULT
CLASS
LABEL
COLOR 0 0 0
FONT mono
TYPE truetype
SIZE 6
OUTLINECOLOR 255 255 254
FORCE true
POSITION cl
#OFFSET 0 0
END
END
PROJECTION
"init=epsg:26915"
END
GRID
LABELFORMAT "NG1"
END
END
LAYER
NAME "ng2"
TYPE LINE
STATUS DEFAULT
CLASS
LABEL
COLOR 0 0 0
FONT mono
TYPE truetype
SIZE 12
OUTLINECOLOR 255 255 254
FORCE true
POSITION cl
END
END
PROJECTION
"init=epsg:26915"
END
GRID
LABELFORMAT "NG2"
END
END
LAYER
NAME "ng3"
TYPE LINE
STATUS DEFAULT
CLASS
LABEL
COLOR 0 0 0
FONT mono
TYPE truetype
SIZE 6
OUTLINECOLOR 255 255 254
FORCE true
#OFFSET 0 0
POSITION cl
END
END
PROJECTION
"init=epsg:26915"
END
GRID
LABELFORMAT "NG3"
END
END
END ## end Map
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080318/52929ab7/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MN_USNG_grid3_ramsey_public.map-4.99-pwcs-01.png
Type: image/png
Size: 19074 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080318/52929ab7/attachment.png>
More information about the MapServer-users
mailing list