Map Typography – Route Station Labels in ArcMap

Posted by in ArcMap, Design, GIS, Labeling

Setting up labels for stationing in ArcMap can be a little tricky. First, you’ve got to have a route – if your line isn’t a route, use either the Route Editing toolbar or the Linear Referencing tools to turn it into a route.

The first step in creating the stationing ticks and labels is to visit the Hatched tab in your route features layer properties.

Stn01

Next, specify the hatch interval, the units are the same as the linear unit of the feature class. In this case my hatch interval is 1000ft, so I will have a hatch & label every 1000ft along the line. Check the Hatch features in this layer and Hatch Class check boxes, you may have to add a class to get started.

Click on Hatch Def.

Stn02

You can choose the hatch line symbol by clicking the symbol preview box to the right of the Marker radio button. The length of the line on teh map is defined in ground units, not page units, it may take some trial and error to find the right size for your map. One important setting to note is the Hatch Orientation button, click this to define how the hatched are oriented to the route line, I usually choose center.

Stn03

The hatch marks are the easy part. The labeling is a little more interesting. To add labels to the hatches, check the Label these hatches check box.

Next, hit the symbol button to define the text symbol for each hatch label.

Now hit the Label Settings button. To define the station measurements, I use a python expression to format the text string in the 000+00 stationing label style.

Stn04

Hit the Build a text expression radio button then the Expression button.

Stn05

Choose the Python parser and click the Advanced check box.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def FindLabel (esri__measure):
  EM = str(int(round(esri__measure)))
  if len(EM) == 0:
    return "0+00"
  elif len(EM) == 1:
    return "0+0{0}".format(*EM)  
  elif len(EM) == 2:
    return "0+{0}{1}".format(*EM)
  elif len(EM) == 3:
    return "{0}+{1}{2}".format(*EM)
  elif len(EM) == 4:
    return "{0}{1}+{2}{3}".format(*EM)
  elif len(EM) == 5:
    return "{0}{1}{2}+{3}{4}".format(*EM)
  elif len(EM) == 6:
    return "{0}{1}{2}{3}+{4}{5}".format(*EM)

This code uses the esri__measure, the length along the route, to display stationing for each hatch label. The EM variable converts the esri__measure into a whole integet as well as converting it to a string for label display. Each elif returns the measure in stationing +00 format based on the length of the measurement. So, for the first hatch along the line at the interval, 1000′, the length of the label is 4 and this label corresponds to this line in the code above:

1
2
  elif len(EM) == 4:
    return "{0}{1}+{2}{3}".format(*EM)

The .format used with the curly brackets index the value of the esri__measure and return each number. For 1000, {0} is 1, {1} is 0, then the + is inserted, then {2} is 0, and {3} is 0. So, at the first hatch the esri__measure is 1000 and the label that is returned is 10+00. Apply these settings and you should have hatching and station labels.

Stn06

5 Comments

  1. Dan
    June 27, 2014

    Thanks for this, really helpful…

    Reply
  2. Rudy
    July 25, 2014

    Thanks for providing this information. I had to change it a little in order to make it work for my project.

    Rudy

    Reply
  3. adam
    October 6, 2015

    Well done, this is awesome

    Reply
  4. Mharckus
    April 10, 2016

    Thanks a lot. Big help!

    Reply
  5. Luis
    June 22, 2016

    Hi, i need to start at a different number of 0, for example the first label “300+00” THANKS FOR YOUR HELP

    Reply

Leave a Reply