Labeling roads

Steve Lime Steve.Lime at DNR.STATE.MN.US
Tue Nov 6 13:29:55 PST 2007


You have to do this in two steps. One for to draw the roads themselves and another
to draw the annotation. Generally roads with shields aren't that common so the performance
hit for 2 passes isn't too bad.

Steve

>>> On 11/6/2007 at 1:20 PM, in message <20071106192039.75CD5C26 at mx1.iway.na>,
Andre Schoonbee <andresch at IWAY.NA> wrote:
> Thanks Steve, but may I be blond...
> 
> 
> In my layer definition, I have specified the line type as follows, - can I
> simply add the Style for the shield.png at the end of my 2 styles, or at
> what stage do I define the "Labeling symbol"?
> 
>  
> NAME "Roads"
>      STATUS ON
>      TYPE ANNOTATION
>      STATUS DEFAULT
> #     TYPE LINE
>      CONNECTIONTYPE postgis
>      CONNECTION "user=postgres password=postgres dbname=posgis_ascii
> host=localhost port=5432"
>      DATA "the_geom from roads"
> 
>      CLASSITEM "type" # field used by EXPRESSION in class objects
>     
>     # Begin classes for Freeways
>      CLASS
>        EXPRESSION ('[type]' = 'Freeway')
>        NAME "Freeways"
>        MAXSCALE 1000000
>        MINSCALE 500001
>        STYLE # Draw the outline
>          SYMBOL 'circle'
>          COLOR 0 0 0
>          SIZE 6
>        END
>        STYLE # Draw the center redline
>          SYMBOL 'circle'
>          COLOR 255 0 0
>          SIZE 4
>        END
>      END
> 
> 
> Regards
> 
> Andre
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
> Behalf Of Steve Lime
> Sent: Tuesday, November 06, 2007 4:58 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU 
> Subject: Re: [UMN_MAPSERVER-USERS] Labeling roads
> 
> Hi Andre: You use annotation layers. I think the demo shows this off. A
> layer
> would look like:
> 
> LAYER
>   NAME 'road_anno'
>   TYPE ANNOTATION
>   STATUS DEFAULT
>   DATA 'roads'
>   LABELITEM 'roadnum'
>   CLASS
>     STYLE
>       SYMBOL 'shield.png'
>     END
>     LABEL
>       COLOR 0 0 0
>       SIZE TINY
>     END
>   END
> END
> 
> Steve
> 
>>>> Andre Schoonbee <andresch at IWAY.NA> 11/05/07 8:32 AM >>>
> How can I label a road by using the state symbol and putting the road no on
> top of it?
> 
> Andre



More information about the MapServer-users mailing list