Ask A Cartographer

Labeling contours

February 12 2008 | 8 comments

Is it possible to break the contour beneath a label as opposed to using a mask on the label?

Mapping Center Answer:

The best solution would probably be variable-depth masking, unless you have a background that is only one color. If you do have a single color background, you can use a halo effect on the text – make the halo the same color as the background.

More often, you will have a multi-color background (e.g., a hillshade with a layer tint). For this, use variable depth masking which is a drawing technique for hiding parts of one or more layers. It helps to clarify the legibility of a map that is packed with text and features. With this technique, you create a polygon mask layer based on an annotation layer, and then mask out some feature symbology to make the map more readable. For your case, you will create masks for contour line annotation so that the lines are labeled more clearly.

The first thing you need to do is create annotation from the contour line labels. You can right click on the layer with the labels and select Convert Labels to Annotation. Variable Depth Masking requires geodatabase annotation so be sure to select the option to store the annotation in a database.

In ArcInfo 9.x, in ArcToolbox, there is a Cartography Toolbox that contains the masking tools. To create masks for the annotation, use the tool that creates mask polygons at a specified distance and shape around the features in the input layer. This is the Feature Outline Masks Tool.

Use it to create some masks for your contour line annotation layer. Click the Input Layer dropdown arrow and select the annotation layer you created. Then type the name and location for the Output Feature Class. Because you’re using an annotation layer, the reference scale will be automatically set. Type a value in the Margin parameter – we will often use 1 point – and click the Mask kind dropdown arrow to select an outline method.

We’ll usually use Convex Hull which represents the shape of the text, but not the internal holes. This is the recommended method. Now click OK.

For Variable Depth Masking to work, the mask layer must be in the data frame. Right-click the data frame in the table of contents and click Advanced Drawing Options. Check “Draw using masking options specified below”. You would uncheck this if you wanted to turn masking off. Click the layer to use as a mask in the Masking Layers list – that should be the annotation mask layer you created. Then check the layers you want affected by the mask – those would nominally be the contour line layer(s). Click OK.

At this point turn off but don’t remove the mask layer. You should now be able to see legible contour labels!

Note that this is also described with accompanying graphics in the presentation we gave at the 2004 ESRI User Conference titled "ArcGIS Cartography: Creating Advanced Effects for Cartography in ArcMap" – scroll down and you will find it on the Other Resources – Presentations page of Mapping Center.

Link not working posted by Sue Wiseman on Mar 14 2008 10:16AM
I would like to read this but the link doesn't seem to work to open the actual presentation document.
Recent activity causing a bit of instability posted by Charlie Frye on Mar 14 2008 10:40AM
We've been making some wholesale updates to the resources pages over the last couple of days; I just checked again, and it's working and the PDF is there.
This works great! posted by Kevin Hanson on Jun 18 2009 8:36AM
Just wanted to mention that this works perfect. Thanks for all your hard work!
Glad to help! posted by Aileen Buckley on Jun 18 2009 10:54AM
Glad to know this works for you! It helps us to get feedback like this to hear how things are going for our users. Thanks for taking the time to let us know!
Would really like to read article.... posted by Mary Edin on Aug 26 2009 11:04AM
The link takes me to the page, but the pdf is not accessible for this article. Is there something I am doing wrong? The page turns blue but nothing happens. Thanks,
Link is OK now posted by Aileen Buckley on Sep 11 2009 4:04PM
Looks like the link is OK now - please let us know if you are still having problems.
Map using variable-depth masking posted by Kevin Hanson on Oct 15 2009 11:38AM
I just wanted to show the result of using variable-depth masking on contour intervals with a varied colored background.

(Save the map to your hard drive for faster results)

I am now using this technique on all the future Construction Aggregate Resource maps for MN. Next publication will be October 28th, 2009, of Olmsted County, MN Plate A and B.

Thanks again!
-Kevin Hanson
Turn off mask layer! posted by Brian Sims on Oct 1 2010 4:07PM
Key detail missing from the ArcMap help document on this subject. Once you go through all the steps to create the mask layer and associate the mask layer with the contour line(s) to be masked you have to turn the layer off in the ToC. Thank you for pointing out this key detail that is missing from the help documents!

If you would like to post a comment, please login.

Contact Us | Legal | Privacy |