.. _sym_examples: ***************************************************************************** Symbology Examples ***************************************************************************** :Author: Jeff McKenna :Contact: jmckenna at gatewaygeomatics.com :Revision: $Revision$ :Date: $Date$ :Last Updated: 2008/07/16 .. contents:: Table of Contents :depth: 2 :backlinks: top The following example creates a dashed line with 10 pixels on, 5 off, 5 on, 10 off ... Example 1. Dashed Line --------------------------------------------- .. code-block:: mapfile SYMBOL NAME 'dashed1' TYPE ELLIPSE POINTS 1 1 END FILLED true PATTERN 10 5 5 10 END END The next example symbol is a star, used to represent the national capital, hence the name. The font name in defined in the :ref:`FONTSET` file. The code number "114" varies, you can use MS Windows' character map to figure it out, or guestimate. Example 2. TrueType font marker symbol --------------------------------------------- .. code-block:: mapfile SYMBOL NAME "natcap" TYPE TRUETYPE FONT geo FILLED true ANTIALIAS true CHARACTER "r" END The next example is fairly straight forward. Note that to have 3 sides you need 4 points, hence the first and last points are identical. Example 3. Vector triangle marker symbol --------------------------------------------- .. code-block:: mapfile SYMBOL NAME "triangle" TYPE vector POINTS 0 4 2 0 4 4 0 4 END END The next example draws a cross, that is 2 lines (vectors) that are not connected end-to-end (Like the triangle in the previous example). The negative values separate the two. Example 4. Non-contiguous vector marker symbol (Cross) ------------------------------------------------------- .. code-block:: mapfile SYMBOL NAME "cross" TYPE vector POINTS 2 0 2 4 -99 -99 0 2 4 2 END END The next example creates a simple filled circle. Using non-equal values for the point will give you an actual ellipse. Example 5. Circle vector symbol --------------------------------------------- .. code-block:: mapfile SYMBOL NAME "circle" TYPE ellipse FILLED true POINTS 1 1 END END Example 6. Downward diagonal fill --------------------------------------------- .. code-block:: mapfile SYMBOL NAME "downwarddiagonalfill" TYPE vector TRANSPARENT 0 POINTS 0 1 1 0 END END The next example creates a dashed line with 10 pixels on, 5 off,... The line will have butt caps and short miter joins. For layers with a scaled symbol (SYMBOLSCALE, MINSIZE, MAXSIZE, ...) the PATTERN will be resized to maintain symbol ratios. Example 7. Dashed Cartoline symbol --------------------------------------------- .. code-block:: mapfile SYMBOL NAME "cartoline" TYPE cartoline LINECAP butt LINEJOIN miter LINEJOINMAXSIZE 1 PATTERN 10 5 END END Example 8. Using the Symbol Type HATCH (new in 4.6) ---------------------------------------------------- As of MapServer 4.6, you can now use the symbol type HATCH to produce hatched lines. The following will display hatched lines at a 45 degree angle, 10 pixels apart, and 3 pixels wide. Symbol definition: .. code-block:: mapfile SYMBOL NAME 'hatch-test' TYPE HATCH END Layer definition: .. code-block:: mapfile LAYER ... CLASS ... STYLE SYMBOL 'hatch-test' COLOR 255 0 0 ANGLE 45 SIZE 10 WIDTH 3 END END END Other parameters available for HATCH are: ANGLEITEM, SIZEITEM, MINWIDTH, and MAXWIDTH.