Synopsis:The MapServer comes with 3 default symbol files which are located in the symbols sub-directory of the distribution. The files are called shade.sym, line.sym, and marker.sym and may be edited or replaced at your leisure provided the names remain the same. Note that symbol 0 is always the degenerate case for a particular class of symbol. For points, symbol 0 is a single pixel, for shading (i.e. filled polygons) symbol 0 is a solid fill, and for lines, symbol 0 is a single pixel wide line.
Notes: Symbol files contain no information about colors. Color information is set within a class definition in the mapfile.
Utilities: Included with the distribution is a utility called sym2gif which will create a GIF/PNG file from a symbol file. Run the program with no arguments to get the syntax.
Format: Symbol files are ASCII text files. A symbol file must start with one of the following keywords: SHADESET, LINESET or MARKERSET that defines the type of symbols that follow. The file must end with the keyword end. Here's the general format:
MARKERSET|SHADESET|LINESET
Symbol
(options)
END # Symbol
(more symbols)
END # Symbol file
Shade and marker symbols have identical symbol formats and options, line symbols have a few additional options. At present the maximum number of symbols in a file is 31. This can be increase (or decreased) by editing mapsymbol.c and bumping the appropriate #defines at the top of the file.
You can create non-continuous paths by inserting negative coordinates at the appropriate place. Here's an example that defines a simple VECTOR cross or plus sign:
Filled: sets symbol so that it is filled with a user defined color (see mapfile documentation for more information on colors). For marker symbols, if outlineColor was specified in the mapfile then the symbol is outlined with it.
Transparent [color index]: sets a transparent color for the input GIF image for PIXMAP symbols, or determines whether all shade symbols should have a transparent background. For shade symbols it may be desireable to have background features"show through" a transparent hatching pattern, creating a more complex map. Here's an example:
By default a symbols background is the same a the parent image (i.e. color 0). This is user configurable.
Line symbols support all the options detailed above. Only new options are detailed below.
Anyway, here are a couple of examples:
Style
-1 0 0
0 0 0
1 0 0
END
Style
-1 0 0
0 8 8
1 0 0
END
Style
-1 1 8
0 0 0
1 1 8
END