{"id":3622,"date":"2022-03-11T14:52:03","date_gmt":"2022-03-11T01:52:03","guid":{"rendered":"http:\/\/blogs.lincoln.ac.nz\/gis\/?p=3622"},"modified":"2023-05-07T02:46:41","modified_gmt":"2023-05-07T02:46:41","slug":"some-labels-are-better-than-others","status":"publish","type":"post","link":"https:\/\/blogs.lincoln.ac.nz\/gis\/some-labels-are-better-than-others\/","title":{"rendered":"Some labels are better than others"},"content":{"rendered":"<p><em>In this post we look at some clever contour labelling to make your maps sparkly with masking.<\/em><\/p>\n<p>We&#8217;ve been talking about map making in the GIS courses recently, which shouldn&#8217;t come as a surprise to anyone.\u00a0 Making effective maps to communicate your analysis results is an essential GIS skill.\u00a0 In one class we were looking at elevation contours and what they add to maps and got the point shown below for Quail Island:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3624\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Base-1.jpg\" alt=\"\" width=\"1627\" height=\"889\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Base-1.jpg 1627w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Base-1-300x164.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Base-1-1024x560.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Base-1-768x420.jpg 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Base-1-1536x839.jpg 1536w\" sizes=\"auto, (max-width: 1627px) 100vw, 1627px\" \/><\/p>\n<p>I&#8217;m keeping this simple to illustrate a point but for now, I&#8217;ve chosen a colour and line thickness for the contours to roughly match what people are used to seeing on the 1:50,000 scale topomaps.\u00a0 Knowing that there&#8217;s an attribute called SPOT that has the elevation, it would be nice to label these so people know what each that is for each contour.\u00a0 Easy enough!<\/p>\n<p>With the Contours layer selected in the Contents pane, I&#8217;ve got a Labeling ribbon available:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3625\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/LabelRibbon.jpg\" alt=\"\" width=\"1394\" height=\"120\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/LabelRibbon.jpg 1394w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/LabelRibbon-300x26.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/LabelRibbon-1024x88.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/LabelRibbon-768x66.jpg 768w\" sizes=\"auto, (max-width: 1394px) 100vw, 1394px\" \/><\/p>\n<p>With the Field set to SPOT and clicking the Label button, they appear on my map:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3626\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Contour1.jpg\" alt=\"\" width=\"1006\" height=\"826\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Contour1.jpg 1006w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Contour1-300x246.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Contour1-768x631.jpg 768w\" sizes=\"auto, (max-width: 1006px) 100vw, 1006px\" \/><\/p>\n<p>Not ideal &#8211; I&#8217;d much rather have the labels set up the way they would normally be &#8211; with the label in line with the contour.\u00a0 Towards the right of the ribbon there are some preset placements for labels, with Contours being among them (it&#8217;s on the second row):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3627\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Placement.jpg\" alt=\"\" width=\"265\" height=\"93\" \/><\/p>\n<p>Let&#8217;s try it &#8211; straight away an improvement, but still not great &#8211; they&#8217;ve just been plonked straight on top:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3628\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Contour2.jpg\" alt=\"\" width=\"571\" height=\"416\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Contour2.jpg 571w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Contour2-300x219.jpg 300w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/p>\n<p>I&#8217;d like to remove the line underneath the contour value, like you would see on the topomaps:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3641\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/topo-1.jpg\" alt=\"\" width=\"1022\" height=\"811\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/topo-1.jpg 1022w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/topo-1-300x238.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/topo-1-768x609.jpg 768w\" sizes=\"auto, (max-width: 1022px) 100vw, 1022px\" \/><\/p>\n<p>(In an earlier post we talked about how to <a href=\"http:\/\/blogs.lincoln.ac.nz\/gis\/index-contours-made-easy\/\" target=\"_blank\" rel=\"noopener noreferrer\">only label certain contours<\/a>.)<\/p>\n<p>My first thought was that I&#8217;ll use Halos to create this effect.\u00a0 This will use Symbology to make a sort of buffer around each of the labels.\u00a0 I&#8217;ll make\u00a0the halo the same colour as the background so it makes some space around each label:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3630\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/WithHalo.jpg\" alt=\"\" width=\"1636\" height=\"858\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/WithHalo.jpg 1636w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/WithHalo-300x157.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/WithHalo-1024x537.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/WithHalo-768x403.jpg 768w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/WithHalo-1536x806.jpg 1536w\" sizes=\"auto, (max-width: 1636px) 100vw, 1636px\" \/><\/p>\n<p>(I cheated a little bit here &#8211; to get the colour exactly right, I used the Eyedropper in the Color drop down to match it:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3631\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Eyedropper.jpg\" alt=\"\" width=\"287\" height=\"375\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Eyedropper.jpg 287w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Eyedropper-230x300.jpg 230w\" sizes=\"auto, (max-width: 287px) 100vw, 287px\" \/>)<\/p>\n<p>That&#8217;s looking a bit more like it &#8211; until I turn on my Vegetation layer underneath:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3632\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Blots.jpg\" alt=\"\" width=\"513\" height=\"461\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Blots.jpg 513w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Blots-300x270.jpg 300w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/p>\n<p>That halo only works well when the background is always the same colour.\u00a0 There must be another way&#8230;\u00a0 There is!\u00a0 It&#8217;s a bit fiddly, but <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/mapping\/layer-properties\/use-a-masking-layer.htm\" target=\"_blank\" rel=\"noopener noreferrer\">masking<\/a> is a way to make this work.\u00a0 Masking\u00a0allows us to\u00a0hide other features in a layer where there&#8217;s an overlap.\u00a0 We&#8217;ve got three steps to make this work:<\/p>\n<ul>\n<li>Create an annotation layer from the labels<\/li>\n<li>Create a mask layer from the label annotations<\/li>\n<li>Use the mask on layers on the map<\/li>\n<\/ul>\n<p>For most people, <a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/mapping\/pro-map-text-ii-annotation\/\" target=\"_blank\" rel=\"noopener noreferrer\">annotations <\/a>will be a new facet of GIS.\u00a0 I&#8217;ll admit they are for me &#8211; I&#8217;ve always heard about them but never really knew what to do with them.\u00a0 The basic idea is that it takes the labels and converts them to a spatial layer in their own right, rather than\u00a0then just being add-ons to a feature class.\u00a0 (<em>Ed. that last sentence sounded like complete gobbeldy-gook,\u00a0 Just so you know&#8230;<\/em>)\u00a0 They can be very useful in mapping.\u00a0 It&#8217;s easy to do &#8211; just right click on the layer with the labels and go to Convert Labels &gt; Convert Labels to Annotations.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3633\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/LayerToAnno.jpg\" alt=\"\" width=\"296\" height=\"562\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/LayerToAnno.jpg 296w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/LayerToAnno-158x300.jpg 158w\" sizes=\"auto, (max-width: 296px) 100vw, 296px\" \/><\/p>\n<p>(The only thing I changed here was the name of the Output Layer.)\u00a0\u00a0Running this tool adds the annotation layer to the map which will basically be the labels.<\/p>\n<p>Next, we can use the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/cartography\/feature-outline-masks.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Feature Outline Masks<\/a> tool on the label annotations:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3634\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/MakeMask.jpg\" alt=\"\" width=\"295\" height=\"398\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/MakeMask.jpg 295w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/MakeMask-222x300.jpg 222w\" sizes=\"auto, (max-width: 295px) 100vw, 295px\" \/><\/p>\n<p>(I set the Margin to 2 points and the Mask Kind to Convex Hull.)\u00a0 When this output is added to the map it will show areas similar to the halos.\u00a0 Turing it off so it&#8217;s not displayed now is a good idea &#8211; one more step to do.\u00a0 Here it gets a little tricky but I&#8217;ll try to be clear.\u00a0 The layer I want this to have an effect on is the contours, so I select that layer in the Contents pane.\u00a0 Then, under Feature Layer &gt; Appearance, click on Masking in the Drawing group and tick the box for the masking layer:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3636\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Drawing.jpg\" alt=\"\" width=\"332\" height=\"219\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Drawing.jpg 332w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Drawing-300x198.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Drawing-330x219.jpg 330w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/p>\n<p>As long as I&#8217;ve got the masking layer turned off, I get the effect I&#8217;m after &#8211; shown on the right below next to my original effort:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3638\" src=\"https:\/\/d-blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Both.jpg\" alt=\"\" width=\"1216\" height=\"608\" srcset=\"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Both.jpg 1216w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Both-300x150.jpg 300w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Both-1024x512.jpg 1024w, https:\/\/blogs.lincoln.ac.nz\/gis\/wp-content\/uploads\/sites\/3\/2022\/03\/Both-768x384.jpg 768w\" sizes=\"auto, (max-width: 1216px) 100vw, 1216px\" \/><\/p>\n<p>I&#8217;ve probably still got some placement issues to deal with but at least now I&#8217;ve got my labels nicely nestled within their contours and they&#8217;re not calling too much attention to themselves, so for now, happy days&#8230;til the next GIS problem comes along.\u00a0 I&#8217;m sure I won&#8217;t have to wait too long.<\/p>\n<p>C<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post we look at some clever contour labelling to make your maps sparkly with masking. We&#8217;ve been talking about map making in the GIS courses recently, which shouldn&#8217;t come as a surprise to anyone.\u00a0 Making effective maps to communicate your analysis results is an essential GIS skill.\u00a0 In one class we were looking [&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-3622","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/3622","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=3622"}],"version-history":[{"count":1,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/3622\/revisions"}],"predecessor-version":[{"id":4059,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/posts\/3622\/revisions\/4059"}],"wp:attachment":[{"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/media?parent=3622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/categories?post=3622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.lincoln.ac.nz\/gis\/wp-json\/wp\/v2\/tags?post=3622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}