[mapserver-users] MAP File Question

Stephen Woodbridge woodbri at swoodbridge.com
Fri Dec 7 11:27:21 PST 2001


I have a question on how CLASSs work in the MAP file. Specifically in
the following example does the CLASS section work like a switch
statement int C with a break at each END? Such that if NAME = /^State
Hwy / then does it skip the rest of the CLASSs. Or such that I could put
a CLASS at the bottom with no EXPRESSION that could be used as a default
CLASS if non above were executed?

I hope this makes sense to you.
  -Steve

LAYER
  NAME highways
  MAXSCALE 600000
  STATUS ON
  DATA majroads
  TYPE ANNOTATION
  LABELITEM "RTE_NUM"
  CLASSITEM "NAME"
  CLASS
    EXPRESSION /^State Hwy /
    COLOR 0 0 0 # dummy color
    SYMBOL 'state_highway_shield'
    LABEL
      MINFEATURESIZE 25
      MINDISTANCE 150
      POSITION CC
      SIZE TINY
      COLOR 0 0 0
    END
  END
  CLASS
    EXPRESSION /^US Hwy /
    COLOR 0 0 0 # dummy color
    SYMBOL 'us_highway_shield'
    LABEL
      MINFEATURESIZE 25
      MINDISTANCE 150
      POSITION CC
      SIZE TINY
      COLOR 0 0 0
    END
  END
  CLASS
    EXPRESSION /^I-/
    COLOR 0 0 0 # dummy color
    SYMBOL 'interstate_shield'
    LABEL
      MINFEATURESIZE 25
      MINDISTANCE 150
      POSITION CC
      SIZE TINY
      COLOR 255 255 255
    END
  END
END # highway annotation



More information about the MapServer-users mailing list