[mapserver-users] coloring map

Hankley, Chip Chip.Hankley at GASAI.Com
Wed Jun 20 18:03:42 EDT 2001


You can set any layer to be a "thematic" one by manipulating the class
objects in the map file. Here's a snippet from one of my map files.
"Descrip" is the field my colors are based on, EXPRESSION 'COPSE' or
'Cattail' are specifying wh/ records from the shapefile will be colored
accordingly (i.e. the polygons w/ a DESCRIP value of COPSE will be assigned
an RGB color of 243 137 139.

LAYER
  NAME "CurrentPlants"
  TYPE Polygon
  STATUS off
  DATA "\plants"

    CLASSITEM Descrip
      CLASS
	Name "COPSE"
        EXPRESSION 'COPSE'
        COLOR 243 137 139
        OUTLINECOLOR 0 0 0
     END  # CLASS

    CLASSITEM Descrip
      CLASS
	Name "Cattail"
        EXPRESSION 'Cattail'
        COLOR 123 254 205
        OUTLINECOLOR 0 0 0
     END  # CLASS
END # End of Layer

A great cheater tool is the ArcView utility written by Ross Searle
(http://mapserver.gis.umn.edu/contributed.html). If you have access to AV
you can use this tool to create your map files, among other things. By
looking at the output, you can figure out what your map files are supposed
to look like. It has helped me understand the syntax of the map file a lot.

Cheers!

Chip Hankley



More information about the mapserver-users mailing list