[mapserver-users] RE: performance question - labeling roads with shields

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Tue Jan 10 18:29:00 EST 2012


Hi Mark: With the changes in label styles in 6.0 you should be able to combine the layers, for example:

LAYER
  NAME 'major_roads'
  ...
  CLASS
     NAME 'Interstates'
     STYLE # orange lines with a brownish outline
        WIDTH 4 MAXWIDTH 8 MINWIDTH 4
        COLOR 242 191 36
        OUTLINECOLOR 187 176 157
        OUTLINEWIDTH 1
     END
     LABEL
       TYPE TRUETYPE
       SIZE 7
       ...
       STYLE
         SYMBOL 'interstate_shield.png'
       END
     END
  END
END

That should be all there is to it- all in one pass.

Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Mark Volz
Sent: Tuesday, January 10, 2012 1:37 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] performance question - labeling roads with shields

Hello,

On my Application I currently am using two layers to draw my roads.  The first one is a line layer that draws the road itself.  The second is a annotation layer that draws the labels and the road shields.  Both layers have the same source dataset.  My concern is that my application is taking a performance hit since the road file is being read twice.

If there is a performance hit by reading the same data file twice, is there a way combine the line layer and annotation layer into a single layer that has both the road symbology, and labels that have shields?


Layer Roads
...
DATA MyRoads
TYPE LINE
CLASS
                NAME 'State Highway'
                EXPRESSION "A20"
                STYLE
                        COLOR 0 0 0
                        SYMBOL 'plainline'
                        SIZE 5
                END #style
                STYLE
                        SYMBOL 'plainline'
                        SIZE 1
                        COLOR 255 0 0
                END #style
        END #class
...
END #LAYER
Layer RoadLabels
        ...
        Data MyRoads
        TYPE ANNOTATION
        CLASS
                TEXT ([ROADNUM])
                EXPRESSION 'A20'
                SYMBOL './symbols/STHWY.png'
                LABEL
                        type truetype  # AGG required
                        size 7 #for AGG
                        ANTIALIAS TRUE
                        FONT vera_sans  #for AGG
                        MINFEATURESIZE 25
                        MINDISTANCE 200
                        COLOR 254 254 254
                END #LABEL
        END #CLASS
END #Layers

Thank You


Mark Volz
GIS Specialist



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120110/8706cac5/attachment-0001.html


More information about the mapserver-users mailing list