Index contours help the map reader get a better feel for the topography of an area.  Symbolising index contours is easy to do with a little bit of preparation. 

In an earlier post we looked at creating elevation contours:

This time we’ll look at how we can better display our contours by symbolising some index contours.  If you’ve spent any time with topographic maps you’ll be familiar with these – at some multiple of the contour interval (the vertical distance between contours) we use thicker lines to highlight the elevation change.  On our 1:50,000 scale topo maps with a contour interval of 20 m, these index contours are used every 100 m, as shown below:

Every 100 ms above sea level, the contour is a darker, thicker brown and is also labelled with the elevation, while the others are lighter, thinner and have no label.  So the trick here is to easily be able to identify those contours and then give yourself an attribute to differentiate between the two.

For this task we’ll add a new field to our Contours attribute table, add a default value of 0 to all the records, then select the index contours and give them a value of 1.  Nothing special about 0 and 1; they’re just convenient.  We could just as easily use A and B or Bret and Jemaine.  That said, let’s use Bret and Jemaine instead.

Just as a reminder, here are the contours I derived earlier:

And here’s a quick look at my attribute table:

I’ve got the Contour attribute highlighted and you can see that they are multiples of 20 m.  First step is to add a new field.  Given the names I’m using, it will be a text field and only needs to be 7 characters long (“Jemaine”) but I’ll make it 10 to be safe.  From the table menu I’ll pick “Add Field…”

I’ll call that field “Index” set the type to Text and make the length 10.

Next, I’ll do a field calculation to add “Jemaine” to all the fields as the default value.  Later I’ll come back and change the entry for the index contours:

(NB: when using the Field Calculator to add text, don’t forget to put your entry in quotes.)

Next, we can select those contours that are multiples of 100.  This is a small enough layer that if we really wanted to we could just do it manually by sorting our Contour values and only changing the ones we need to.  We’ll use Select by Attribute to show how we can do this for larger datasets.  Now how can we efficiently use a query to pick out all the contours whose elevation value is a multiple of 100?

Those of you who have done any coding will likely have come across the modulo function.  Put very simply, the modulo function gives you what remains after division.  So let say we divide 5 by 2, which is of course 2.5, or 2 and 1/2.  The remainder is 1 (since 2 x 2 = 4 with 1 left over).  In contrast, 9 divided by 3 is 3 with no remainder.  Another way to write this is 5 mod 2 = 1 and 9 mod 3 is 0.  We can use this logic to select all our contours that have no remainder when divided by 100.  (Hope that makes sense…).  We can use this is the Select by Attribute window in this way:

The key phrase here is: MOD(Contour, 100) = 0.  It is a true/false statement and all the true results will get selected.  Read this as (roughly): “Divide all Contour values by 100 and select those that have 0 as a remainder”.  Here’s the result:

Now we’ll use the Field Calculator to change the value of Index for all the selected records to “Bret”

Right – that’s the hard part.  Now we’ve got enough information to start symbolising things.

In the layer’s Properties > Symbology tab we should set Show to Categories > Unique values, set the Value Field to Index and click “Add All Values” (don’t forget to untick <all other values>):

To set these up we’ll aim to recreate the colours used on the 1:50K topo maps.  We know that the Bret values should be our index contours while the others are just your regular run of the mill contours.  I’ll make those ones thicker and darker brown and the others the opposite (poor Jemaine, he won’t like that).

With this result:

Well that’s not too bad, eh?  I might think about softening the contours a bit by either making this layer a bit more transparent or slighting reducing the thickness – they’re drawing a bit too much attention to themselves right now, but I’ll worry about that later.

I think this has gone on quite long enough so I’ll cover the labeling side of things in another post.  Those of you still awake can tune in next time for the dramatic conclusion to our contouring efforts.