ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Feature Outline Masks

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Creates mask polygons at a specified distance and shape around the symbolized features in the input layer.

Usage

  • This tool accepts point, line, and polygon feature layers as well as geodatabase annotation layers as input.

  • When creating masks, it is important to know that adding masks to maps adds complexity that will slow map drawing and affect map printing and exporting. Generally, there are three things to consider when creating masks for a map: (1) the number of masks, (2) the complexity of the masks, and (3) whether the masks will be used to mask polygon features filled with marker or line symbols. An increase in the number of masks, having more complex masks, and/or masking against marker or polygon fill symbols will result in slower drawing on your screen. In addition, printing and exporting performance can be poor and even fail to produce valid output, first, because of the large amount of processing required to print and export maps with masks, and second, because of known limitations in how graphic file formats store map export results that have many complicated masks.

  • When seeking to improve drawing performance as well as printing and exporting performance and reliability, the most important guideline to follow is to use the simplest masks necessary for the purposes of your map. In particular, when masking annotation text, you will find that CONVEX_HULL type masks are sufficient for many map purposes. If you need more detailed text masks, then use the EXACT_SIMPLIFIED type. Generally, when masking much text on a relatively large map, avoid using the EXACT type mask because it will create too many complicated masks to produce valid output efficiently.

  • Margin values are specified in either page units or map units. Most of the time you will want to specify your margin distance value in page units.

    Margin value units are interpreted differently depending on which units you choose. If you choose points, inches, millimeters, or centimeters, then masks are created using the margin distance as calculated in page space (you can think of the margin as a distance measured on the paper). The reference scale parameter value is accounted for in this calculation.

    If you choose any other units for your margin, then masks are created using the margin distance as calculated in map space (you can think of the margin as a real-world distance measure on the earth). Also, in this case, the reference scale parameter value is not used as part of the calculation.

  • Masks will be created if the margin distance is 0 or negative. A margin size of 0 will create a polygon that represents the exact shape of the symbolized feature. A negative margin will result in a polygon smaller than the symbolized feature. Generally, a margin value larger than 0 will be specified to produce the desired masking effect.

  • If the input layer is an annotation layer, the reference scale will be automatically set to the reference scale of the layer's feature class to ensure accurate calculation of the mask.

  • When masking annotation projected on the fly, masks should be created using the map's spatial reference by properly setting it in the spatial reference parameter. Readability is preserved when text is projected on the fly, which is why there may be differences in the spatial area that text occupies in different projections.

  • Masks of annotation features are font specific. When using masks with text, it is important to ensure that the same font is used onscreen as in the output. To do this, choose to embed fonts in vector output or download SoftFonts to printers or plotters.

Syntax

FeatureOutlineMasks_cartography (input_layer, output_fc, reference_scale, spatial_reference, margin, method, mask_for_non_placed_anno, {attributes})
ParameterExplanationData Type
input_layer

The symbolized input layer from which the masks will be created.

Layer
output_fc

The feature class that will contain the mask features.

Feature Class
reference_scale

The reference scale used for calculating the masking geometry when masks are specified in page units. This is typically the reference scale of the map.

Double
spatial_reference

The spatial reference for which the masking polygons will be created. This is not the spatial reference that will be assigned to the output feature class. It is the spatial reference of the map in which the masking polygons will be used since the position of symbology may change when features are projected.

Spatial Reference
margin

The space in page units surrounding the symbolized input features used to create the mask polygon. Typically, masking polygons are created with a small margin around the symbol to improve visual appearance. Margin values are specified in either page units or map units. Most of the time you will want to specify your margin distance value in page units.

Margin value units are interpreted differently depending on which units you choose. If you choose points, inches, millimeters, or centimeters, then masks are created using the margin distance as calculated in page space (you can think of the margin as a distance measured on the paper). The reference scale parameter value is accounted for in this calculation.

If you choose any other units for your margin, then masks are created using the margin distance as calculated in map space (you can think of the margin as a real-world distance measure on the earth). Also, in this case, the reference scale parameter value is not used as part of the calculation.

Linear unit
method

The type of masking geometry created. There are four types:

  • BOX —A polygon representing the extent of the symbolized feature.
  • CONVEX_HULL —The convex hull of the symbolized geometry of the feature. This is the default.
  • EXACT_SIMPLIFIED —A generalized polygon representing the exact shape of the symbolized feature. Polygons created with this method will have a significantly smaller number of vertices compared to polygons created with the EXACT method.
  • EXACT —A polygon representing the exact shape of the symbolized feature.
String
mask_for_non_placed_anno

Specifies whether to create masks for unplaced annotation. This option is only used when masking geodatabase annotation layers.

  • ALL_FEATURES —Creates masks for all the annotation features.
  • ONLY_PLACED —Only creates masks for features with a status of placed.
String
attributes
(Optional)

Determines which attributes will be transferred from the input features to the output features.

  • ONLY_FID —Only the FID field from the input features will be transferred to the output features. This is the default.
  • NO_FID —All the attributes except the FID from the input features will be transferred to the output features.
  • ALL — All the attributes from the input features will be transferred to the output features.
String

Code Sample

FeatureOutlineMasks tool Example (Python Window)

The following Python window script demonstrates how to use the FeatureOutlineMasks tool in immediate mode.

import arcpy
from arcpy import env
env.workspace = "C:/data"
sr = arcpy.SpatialReference(4326)
arcpy.FeatureOutlineMasks_cartography("C:/data/cartography.gdb/transportation/roads",
                                "C:/data/cartography.gdb/transportation/fom_polys",
                                "25000", sr, "5 meters","EXACT_SIMPLIFIED", "ALL_FEATURES", "ALL")
FeatureOutlineMasks tool Example (stand-alone Python script)

This stand-alone script shows an example of using the FeatureOutlineMasks tool.

# Name: FeatureOutlineMasks_standalone_script.py
# Description: Creates mask polygons at a specified distance and shape
#           around symbolized features. 
 
# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
input_layer = "C:/data/roads.lyr"
output_fc = "C:/data/cartography.gdb/transportation/fom_polys"
reference_scale = "25000"
spatial_reference = arcpy.SpatialReference(4326)
margin = "5 meters"
method = "EXACT_SIMPLIFIED"
mask_for_non_placed_anno = "ONLY_PLACED"
attributes = "ALL"

# Execute Feature Outline Masks
arcpy.FeatureOutlineMasks_cartography(input_layer,
                                      output_fc,
                                      reference_scale,
                                      spatial_reference,
                                      margin, method,
                                      mask_for_non_placed_anno,
                                      attributes)

Environments

  • Cartographic Coordinate System
  • Reference Scale

Licensing Information

  • ArcGIS for Desktop Basic: No
  • ArcGIS for Desktop Standard: No
  • ArcGIS for Desktop Advanced: Yes

Related Topics

  • An overview of the Masking toolset
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal