[mapserver-dev] Labeling Highway Shields Idea

Steve Lime Steve.Lime at dnr.state.mn.us
Thu May 21 18:01:22 EDT 2009


I'll have to ponder your suggestion but offhand I think the styleObj TYPE could also be a mechanism
to achieve this. I mean, you can already add arrow heads to lines you draw so it would make sense
to use something along those lines. Will have to go back to that RFC...

Steve

>>> On 5/21/2009 at 4:50 PM, in message <4A15CCC3.5080101 at swoodbridge.com>, Stephen
Woodbridge <woodbri at swoodbridge.com> wrote:
> Hi all,
> 
> Currently, unless I'm out of date, if you want to place highway shields 
> that are symbols as part of a label you have to use an annotation layer 
> to place the shield as a symbol(s) and the label over top of that with 
> the number.
> 
> So this requires, two passes over the data, one to render the highways 
> and a second pass over the data to place the shields. It also requires 
> defining and maintaining two layers in place of one.
> 
> A proposal for an alternate way:
> 
> One way to do this would be to allow STYLE block(s) to be placed in the 
> LABEL block and these would use the base label point and be rendered 
> before the label text and only if the label test is rendered. I say base 
> label point, because you would still want to be able to use OFFSET x y 
> to align the label text with the shield symbols. I suppose you could 
> allow OFFSET x y in the STYLE block to allow separate positioning of the 
> symbols and to get multiple symbols to align correctly with one another.
> 
> The following is an example of how this might look. Sorry, I copied it 
> from the cpp input file but it should be easy to understand. 
> _label(font,size,color) is a macro simplify the files. If USE_SHIELDS is 
> defined it would use the proposal above and render the interstate 
> shields which is actually three symbols representing the red, white and 
> blue parts of the shield where each is a vector symbol or you could have 
> one STYLE block that uses an image symbol for the shield. If USE_SHIELDS 
> is not defined then you would get a OSM style highway label in a box, 
> like "[I-290]".
> 
> Thoughts on this?
> 
> If people think this would be a good enhancement, I would be happy to 
> write up a ticket for it.
> 
> Thanks,
>    -Steve
> 
>      CLASS ## Interstate
>        EXPRESSION "1"
>        STYLE
>          WIDTH _motorway_width
>          OUTLINEWIDTH 1
>          OUTLINECOLOR _motorway_ol_clr
>          MINWIDTH _motorway_minwidth
>          MAXWIDTH _motorway_maxwidth
>        END
>        STYLE
>          WIDTH _motorway_width
>          COLOR _motorway_clr
>          MINWIDTH _motorway_minwidth
>          MAXWIDTH _motorway_maxwidth
>        END
> #ifdef USE_SHIELDS
>        LABEL
>          MAXSCALEDENOM 3000000
>          STYLE
>            SYMBOL "interstate-red"
>            COLOR _red_clr
>          END
>          STYLE
>            SYMBOL "interstate-blue"
>            COLOR _blue_clr
>          END
>          STYLE
>            SYMBOL "interstate-white"
>            COLOR _white_clr
>          END
>          _label("arial-bold",10,_white_clr)
>          PRIORITY 1
>          MINSIZE 8
>          MAXSIZE 8
>          MINDISTANCE 150
>        END
> #else
>        LABEL
>          MAXSCALEDENOM 3000000
>          _label("arial-bold",10,_white_clr)
>          PRIORITY 1
>          MINSIZE 8
>          MAXSIZE 8
>          MINDISTANCE 150
>          MAXLENGTH 6
>          BACKGROUNDCOLOR _motorway_lbl_bg_clr
>          BACKGROUNDSHADOWCOLOR _motorway_lbl_shadow_clr
>        END
> #endif
>      END
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org 
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev



More information about the mapserver-dev mailing list