How to Construct Railroad Style lines?

Bill Thoen bthoen at GISNET.COM
Fri Dec 29 16:50:42 EST 2006


Pericles S. Nacionales wrote:
> I recommend reading through the symbology reference...  I see that you pointed 
> out a link to some symbol examples in one of your earlier posts but had you 
> browsed through http://mapserver.gis.umn.edu/docs/reference/symbology/syntax 
> or http://mapserver.gis.umn.edu/docs/reference/symbology/notes, you would 
> have seen a link to one of the definitive guides to MapServer symbology: 
> http://mapserver.gis.umn.edu/docs/howto/cartosymbols 
Ah, perfect! I had seen that, but hadn't gone through it all the way. 
The answer was in there. Since this question comes up in the archives a 
lot, Here's an example modified from that document that produces just 
the kind of symbology I want for a railroad. The way it works that a 
thick (5 pixel wide) squared-off cartoline in a dashed pattern of 1 
pixel with a 10 pixel gap (symbol tie) is laid over a normal line 
(symbol track).

MAP
...
   SYMBOL
      NAME 'track'
      TYPE ELLIPSE
      FILLED TRUE
      POINTS 1 1 END
   END

   SYMBOL
      NAME "tie"
      TYPE cartoline
      LINECAP butt
      LINEJOIN miter
      LINEJOINMAXSIZE 3
      STYLE
         1 10 1 10
      END
   END
...
LAYER
      NAME railroads
      TYPE LINE
      STATUS ON
      CONNECTIONTYPE OGR
      CONNECTION "railroads.TAB"
      LABELITEM "Name"
      CLASS
         NAME "Railroads"
         STYLE
            SYMBOL 'track'
            SIZE 1
            COLOR 128 128 128
            ANTIALIAS TRUE
         END
         STYLE
            SYMBOL "tie"
            SIZE 5
            COLOR 128 128 128
            ANTIALIAS TRUE
         END
      END
   END



More information about the mapserver-users mailing list