Variable depth masking: Contour label example

By Aileen Buckley, Mapping Center Lead

Variable Depth Masking - Thumb

Variable-depth masking is an ArcMap drawing technique (available at the ArcInfo level) for hiding parts of one or more layers. One common use for masking is to clarify the legibility of a map that’s packed with text and features.

In the contour map example below, contour lines and annotation features for the contour labels overlap each other making it difficult to read the contour values.

Variable Depth Masking - Labels with no halos

One approach to making the labels more legible might be to use text halos. This approach is fine if the background is a single color – white in the example below.

Variable Depth Masking - Labels with white halos

But when the background colors vary across the map, for example, when a hillshade and an elevation tint are displayed as in the example below, no one color will work for all the halos.

Variable Depth Masking - Labels with green halos

To remedy this, use variable-depth masking. With variable-depth masking, only some layers are hidden by the masks. By using a mask for the annotation, sections of contour lines are hidden, while the elevation shading underneath the masks remains visible.

Variable Depth Masking - Final map

Variable-depth masking for contour labels involves three steps:

  1. creating annotation from the labels,
  2. using the Feature Outline Masks tool to create masks, and
  3. using the Advanced Drawing Options > Masking settings to specify which layers the masks will mask out.

Creating annotation from the labels

The first thing you need to do is create annotation from the labels. Variable-depth masking requires geodatabase annotation so be sure to select the option to store the annotation in a database when you convert the labels to annotation.

  1. Prepare your labels for conversion by ensuring the proper scale and label properties are set.
  2. To convert labels from one layer, right-click the layer in the ArcMap table of contents. To convert labels from more than one layer, right-click the data frame.
  3. Click Convert Labels to Annotation.
  4. For Store Annotation, click In a database.
  5. Specify the features for which you want to create annotation.
  6. To create feature-linked annotation, check the Feature Linked box. To create standard annotation, leave the box unchecked.

For more information on preparing labels for conversion, see the online help topic About converting labels to annotation.

Using the Feature Outline Masks tool to create masks

Now you can use the annotation layer to create the masks.

In ArcToolbox, the Cartography Toolbox contains the masking tools. To create masks for the annotation, use the Feature Outline Masks tool which creates mask polygons at a specified distance and shape around the features in the input layer.

  1. Open ArcToolbox.
  2. Open the Cartography toolset.
  3. Double click the Feature Outline Masks tool to open it.
  4. Click the Input Layer dropdown arrow and select the annotation layer you created.
  5. Type a name and specify the location for the Output Feature Class.
  6. If you’re using an annotation layer, the reference scale will be automatically set.
  7. You can use the Import option when you set the coordinate system by selecting a layer with the coordinate system you are using for your map – in this example we imported the NAD 27 UTM Zone 10N coordinate system that was already specified for the contours__indexAnno layer.
  8. Type a value in the Margin parameter – in this example, we used two points.
  9. Click the Mask Kind dropdown arrow to select an outline method – in this example, we used Convex Hull, which represents the shape of the text, but not the internal holes. This is the recommended method.
    Variable Depth Masking - Feature Outline Masks
  10. Click OK.
  11. For variable-depth masking to work, the mask layer must be in the data frame, so leave it in the table of contents. But it does not need to be visible, so turn off the visibility for that layer.

Using the Advanced Drawing Options > Masking settings

Now use the Advanced Drawing Options to set the display to specify which layers the masks will affect to make the map more readable.

  1. Right-click the data frame in the table of contents and click Advanced Drawing Options.
    Variable Depth Masking - Data Frame Properties
  2. Check the option to Draw using masking options specified below. You would uncheck this if you wanted to turn masking off.
  3. Click the layer that should be used as a mask in the Masking Layers list – this is the annotation mask layer you created using the Feature Outline Masks tool.
  4. Check the layers you want affected by the mask – in this example those are the index and intermediate Contours.
    Variable Depth Masking - Advanced Drawing Options
  5. Click OK.

The contour labels are now more legible because the index contours directly under the labels and any intermediate contours within two points of the masks break where the annotation masks are located.

Variable Depth Masking - Final map

In this blog entry, we showed you how to use the Feature Outline Mask tool and Advanced Drawing Options for Masking to make the contour lines and labels both more distinguishable. You can also use this technique for other features and labels on your map that create graphic conflicts. Use the Masking tools to create masks for the layers you want to show over other layers and use the Advanced Drawing Tools > Masking options to set the layers that will be “hidden” by the masks.

About the author

Dr. Aileen Buckley is a cartographer who’s been at Esri since 2003. She finds and shares best practices for mapping and analysis with ArcGIS, which leads her to publish widely and present world-wide.

Notify of
Inline Feedbacks
View all comments

Next Article

Explore BlueBikes ride data with ArcGIS Pro Charts

Read this article