[mapserver-users] labels - road shields and road names

Brent Fraser bfraser at geoanalytic.com
Fri Nov 13 13:08:42 EST 2009


Mark,

  Here's how I do it...

Brent

 LAYER
    NAME 'Hwy'
    TYPE ANNOTATION
:
:
    LABELITEM 'NUMBER_1'
    LABELCACHE ON

    CLASS
      STYLE  # Hiway number circle
        SYMBOL "circle"
        SIZE 23
        COLOR 254 254 254  # Off-white so not considered as transparent
        OUTLINECOLOR  0 0 0
      END # STYLE

      LABEL
        POSITION CC
        COLOR            0  0  0
        OUTLINECOLOR 254 254 254
        BUFFER 0
        PARTIALS TRUE
        MINDISTANCE 500
        OFFSET 1 0  # center in circle better
        TYPE TRUETYPE
        FONT 'Arial'
        SIZE 8
      END # LABEL
    END # Class
  END  # Layer


> Hello,
>
> What is the best way to label a road displaying both the road number in a
> shield and the road name along the line.  The following does not seem to
> work
>
>
>
> The following is an attachment for my roads file.
>
> Layer #road annotation
> 	Data '.roads'
> 	Type annotation
> 	Classitem 'class'
> 	CLASS #US HWY shields
> 		TEXT ([ROAD_NUM])
> 		EXPRESSION ('[CLASS]' eq 'A10' and '[ROAD_NUM]' ne '0')
> 		COLOR 0 0 0 # dummy color
> 		SYMBOL '../../symbols/USHWY.png'
> 		LABEL
> 				type truetype  # AGG required
> 				size 7 #for AGG
> 			FONT vera_sans  #for AGG
> 				MINFEATURESIZE 25
> 				MINDISTANCE 200
> 		END #LABEL
> END #CLASS
> 	CLASS #US HWY
> 		MAXSCALEDENOM 75000
> 		TEXT ([FULLNAME])
> 		EXPRESSION ('[CLASS]' eq 'A10' and '[ROAD_NUM]' ne '0')
> 		SYMBOL '../../symbols/USHWY.png'
> 		LABEL
> 			TYPE TRUETYPE
> 			FONT franklin-gothic-heavy
> 			SIZE 7
> 			ANTIALIAS TRUE
> 			OUTLINECOLOR 254 254 254
> 			BUFFER 0
> 			MINFEATURESIZE auto
> 			PARTIALS FALSE
> 			ANGLE AUTO
> 		END #LABEL
> 	END #CLASS
> ...
>
>
>
> Mark Volz
> GIS Specialist
> Lyon County, MN
> 507-532-8218
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>




More information about the mapserver-users mailing list