[mapserver-users] multiple highway shields on a single line
Stephen Woodbridge
woodbri at swoodbridge.com
Tue Oct 18 08:03:35 PDT 2011
On 10/18/2011 9:08 AM, Richard Greenwood wrote:
> I have an area where 4 numbered US highways are coincident (all
> following the same road) that I would like to label with the standard
> US highway shield superimposed with the individual route numbers as
> shown on the attached gif. Any suggestions as to how to accomplish
> this?
Hi Rich,
I think that you would need to do something along these lines, and I'm
not entirely sure you can actually do it.
1. you will need to draw the labels 4 separate times probably using an
annotation layer
2. you need to have 4 attribute columns like N1, N2, N3, N4 where each
highway number is in one column. You might also need 4 shield type
columns like T1, T2, T3, T4 that take values like I, U, S, C for
Interstate, US Hwy, State, and County highways respectively so you can
select the appropriate shield/
3. The using geom processing select the start, end, middle, or
percentage along the line to place the symbol
4. then place the highway shield like normal using
LAYER
...
CLASSITEM "T1"
LABELITEM "N1"
CLASS
EXPRESSION "" # catch and empty slot and NOP
END
CLASS
EXPRESSION "I"
# do the interstate shield
END
CLASS
EXPRESSION "U"
# do US Hwy shield
END
...
END
I started a discussion a while back about allowing multiple LABEL blocks
in a CLASS to facilitate complex labeling like this and for house number
ranges and right and left sides of segments, but it requires a lot of
internal code changes and was put off for future discussion. I think I
have a bug written on this, but don't have the number handy.
-Steve W
More information about the MapServer-users
mailing list