{"id":1903,"date":"2018-03-08T05:11:35","date_gmt":"2018-03-08T05:11:35","guid":{"rendered":"http:\/\/blogs.lincoln.ac.nz\/gis\/?p=1903"},"modified":"2023-05-07T03:37:00","modified_gmt":"2023-05-07T03:37:00","slug":"index-contours-made-easy","status":"publish","type":"post","link":"https:\/\/blogs.lincoln.ac.nz\/gis\/index-contours-made-easy\/","title":{"rendered":"Index Contours Made Easy"},"content":{"rendered":"<p><em>Index contours help the map reader get a better feel for the topography of an area.\u00a0 Symbolising index contours is easy to do with a little bit of preparation.\u00a0<\/em><\/p>\n<p>In <a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/contours-made-simple\/\">an earlier post<\/a> we looked at creating elevation contours:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/Zoomed.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1870\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/Zoomed.jpg\" alt=\"\" width=\"1189\" height=\"694\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/Zoomed.jpg 1189w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/Zoomed-300x175.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/Zoomed-1024x598.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/Zoomed-768x448.jpg 768w\" sizes=\"auto, (max-width: 1189px) 100vw, 1189px\" \/><\/a><\/p>\n<p>This time we&#8217;ll look at how we can better display our contours by symbolising some index contours.\u00a0 If you&#8217;ve spent any time with topographic maps you&#8217;ll be familiar with these &#8211; at some multiple of the contour interval (the vertical distance between contours) we use thicker lines to highlight the elevation change.\u00a0 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:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/GodleyHead.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1860\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/GodleyHead.jpg\" alt=\"\" width=\"1114\" height=\"599\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/GodleyHead.jpg 1114w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/GodleyHead-300x161.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/GodleyHead-1024x551.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2017\/09\/GodleyHead-768x413.jpg 768w\" sizes=\"auto, (max-width: 1114px) 100vw, 1114px\" \/><\/a><\/p>\n<p>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.\u00a0 So the trick here is to easily be able to identify those contours and then give yourself an attribute to differentiate between the two.<\/p>\n<p>For this task we&#8217;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.\u00a0 Nothing special about 0 and 1; they&#8217;re just convenient.\u00a0 We could just as easily use A and B or <a href=\"http:\/\/www.imdb.com\/title\/tt0863046\/?ref_=nv_sr_1\" target=\"_blank\" rel=\"noopener noreferrer\">Bret and Jemaine<\/a>.\u00a0 That said, let&#8217;s use Bret and Jemaine instead.<\/p>\n<p>Just as a reminder, here are the contours I derived earlier:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Reminder.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1904\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Reminder.jpg\" alt=\"\" width=\"690\" height=\"513\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Reminder.jpg 690w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Reminder-300x223.jpg 300w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/a><\/p>\n<p>And here&#8217;s a quick look at my attribute table:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Table.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1905\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Table.jpg\" alt=\"\" width=\"575\" height=\"490\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Table.jpg 575w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Table-300x256.jpg 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/a><\/p>\n<p>I&#8217;ve got the Contour attribute highlighted and you can see that they are multiples of 20 m.\u00a0 First step is to add a new field.\u00a0 Given the names I&#8217;m using, it will be a text field and only needs to be 7 characters long (&#8220;Jemaine&#8221;) but I&#8217;ll make it 10 to be safe.\u00a0 From the table menu I&#8217;ll pick &#8220;Add Field&#8230;&#8221;<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/menu.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1906\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/menu.jpg\" alt=\"\" width=\"328\" height=\"295\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/menu.jpg 328w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/menu-300x270.jpg 300w\" sizes=\"auto, (max-width: 328px) 100vw, 328px\" \/><\/a><\/p>\n<p>I&#8217;ll call that field &#8220;Index&#8221; set the type to Text and make the length 10.<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/AddField.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1907\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/AddField.jpg\" alt=\"\" width=\"308\" height=\"311\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/AddField.jpg 308w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/AddField-297x300.jpg 297w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/AddField-150x150.jpg 150w\" sizes=\"auto, (max-width: 308px) 100vw, 308px\" \/><\/a><\/p>\n<p>Next, I&#8217;ll do a field calculation to add &#8220;Jemaine&#8221; to all the fields as the default value.\u00a0 Later I&#8217;ll come back and change the entry for the index contours:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/JemainEntry.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1908\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/JemainEntry.jpg\" alt=\"\" width=\"572\" height=\"493\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/JemainEntry.jpg 572w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/JemainEntry-300x259.jpg 300w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/a><\/p>\n<p><strong><em>(NB: when using the Field Calculator to add text, don&#8217;t forget to put your entry in quotes.)<\/em><\/strong><\/p>\n<p>Next, we can select those contours that are multiples of 100.\u00a0 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.\u00a0 We&#8217;ll use Select by Attribute to show how we can do this for larger datasets.\u00a0 Now how can we efficiently use a query to pick out all the contours whose elevation value is a multiple of 100?<\/p>\n<p>Those of you who have done any coding will likely have come across the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Modulo_operation\" target=\"_blank\" rel=\"noopener noreferrer\">modulo function<\/a>.\u00a0 Put very simply, the modulo function gives you what remains after division.\u00a0 So let say we divide 5 by 2, which is of course 2.5, or 2 and 1\/2.\u00a0 The remainder is 1 (since 2 x 2 = 4 with 1 left over).\u00a0 In contrast, 9 divided by 3 is 3 with no remainder.\u00a0 Another way to write this is 5 mod 2 = 1 and 9 mod 3 is 0.\u00a0 We can use this logic to select all our contours that have no remainder when divided by 100.\u00a0 (Hope that makes sense&#8230;).\u00a0 We can use this is the Select by Attribute window in this way:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Selection.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1909\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Selection.jpg\" alt=\"\" width=\"390\" height=\"511\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Selection.jpg 390w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Selection-229x300.jpg 229w\" sizes=\"auto, (max-width: 390px) 100vw, 390px\" \/><\/a><\/p>\n<p>The key phrase here is: MOD(Contour, 100) = 0.\u00a0 It is a true\/false statement and all the true results will get selected.\u00a0 Read this as (roughly): &#8220;Divide all Contour values by 100 and select those that have 0 as a remainder&#8221;.\u00a0 Here&#8217;s the result:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/ModTable.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1910\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/ModTable.jpg\" alt=\"\" width=\"578\" height=\"489\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/ModTable.jpg 578w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/ModTable-300x254.jpg 300w\" sizes=\"auto, (max-width: 578px) 100vw, 578px\" \/><\/a><\/p>\n<p>Now we&#8217;ll use the Field Calculator to change the value of Index for all the selected records to &#8220;Bret&#8221;<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Bret.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1911\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Bret.jpg\" alt=\"\" width=\"577\" height=\"492\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Bret.jpg 577w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Bret-300x256.jpg 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/a><\/p>\n<p>Right &#8211; that&#8217;s the hard part.\u00a0 Now we&#8217;ve got enough information to start symbolising things.<\/p>\n<p>In the layer&#8217;s Properties &gt; Symbology tab we should set Show to Categories &gt; Unique values, set the Value Field to Index and click &#8220;Add All Values&#8221; (don&#8217;t forget to untick &lt;all other values&gt;):<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Properties.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1912\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Properties.jpg\" alt=\"\" width=\"670\" height=\"527\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Properties.jpg 670w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Properties-300x236.jpg 300w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/a><\/p>\n<p>To set these up we&#8217;ll aim to recreate the colours used on the 1:50K topo maps.\u00a0 We know that the Bret values should be our index contours while the others are just your regular run of the mill contours.\u00a0 I&#8217;ll make those ones thicker and darker brown and the others the opposite (poor Jemaine, he won&#8217;t like that).<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Symbols.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1913\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Symbols.jpg\" alt=\"\" width=\"669\" height=\"528\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Symbols.jpg 669w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Symbols-300x237.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/Symbols-665x525.jpg 665w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/a><\/p>\n<p>With this result:<\/p>\n<p><a href=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/OnTheMap.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1914\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/OnTheMap.jpg\" alt=\"\" width=\"686\" height=\"474\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/OnTheMap.jpg 686w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2018\/03\/OnTheMap-300x207.jpg 300w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/a><\/p>\n<p>Well that&#8217;s not too bad, eh?\u00a0 I might think about softening the contours a bit by either making this layer a bit more transparent or slighting reducing the thickness &#8211; they&#8217;re drawing a bit too much attention to themselves right now, but I&#8217;ll worry about that later.<\/p>\n<p>I think this has gone on quite long enough so I&#8217;ll cover the labeling side of things in another post.\u00a0 Those of you still awake can tune in next time for the dramatic conclusion to our contouring efforts.<\/p>\n<p>C<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Index contours help the map reader get a better feel for the topography of an area.\u00a0 Symbolising index contours is easy to do with a little bit of preparation.\u00a0 In an earlier post we looked at creating elevation contours: This time we&#8217;ll look at how we can better display our contours by symbolising some index [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1903","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/1903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/comments?post=1903"}],"version-history":[{"count":1,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/1903\/revisions"}],"predecessor-version":[{"id":4125,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/1903\/revisions\/4125"}],"wp:attachment":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media?parent=1903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/categories?post=1903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/tags?post=1903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}