Erase (Analysis)

Available with Advanced license.

Summary

Creates a feature class by overlaying the input features with the erase features. Only those portions of the input features falling outside the erase features are copied to the output feature class.

An alternate tool is available for erase operations. See the Pairwise Erase tool documentation for details.

Illustration

Erase tool illustration

Usage

  • Geometries that are coincident between the Input Features and Erase Feature parameter values will be removed.

  • The Erase Features parameter value can be point, line, or polygon as long as the Input Features parameter value is of the same or lesser order feature type. A polygon erase feature can be used to erase polygons, lines, or points from the input features; a line erase feature can be used to erase lines or points from the input features; a point erase feature can be used to erase points from the input features.

  • Attribute values from the input feature classes will be copied to the output feature class. However, if the input is a layer or layers created by the Make Feature Layer tool and a field's Use Ratio Policy is checked, then a ratio of the input attribute value is calculated for the output attribute value. When Use Ratio Policy is enabled, whenever a feature in an overlay operation is split, the attributes of the resulting features are a ratio of the attribute value of the input feature. The output value is based on the ratio in which the input feature geometry was divided. For example, if the input geometry was divided equally, each new feature's attribute value is assigned one-half of the value of the input feature's attribute value. Use Ratio Policy only applies to numeric field types.

    Caution:

    Geoprocessing tools do not honor geodatabase feature class or table field split policies.

  • This tool will use a tiling process to handle very large datasets for better performance and scalability. For more details, see Geoprocessing with large datasets.

  • This tool may generate multipart features in the output even if all inputs are single part. If multipart features are not desired, use the Multipart To Singlepart tool on the output feature class.

Parameters

LabelExplanationData Type
Input Features

The input feature class or layer.

Feature Layer
Erase Features

The features to be used to erase coincident features in the input.

Feature Layer
Output Feature Class

The feature class that will contain only those input features that are not coincident with the erase features.

Feature Class
XY Tolerance
(Optional)

The minimum distance separating all feature coordinates (nodes and vertices) as well as the distance a coordinate can move in x or y (or both).

Caution:

Changing this parameter's value may cause failure or unexpected results. It is recommended that you do not modify this parameter. It has been removed from view on the tool dialog box. By default, the input feature class's spatial reference x,y tolerance property is used.

Linear Unit

arcpy.analysis.Erase(in_features, erase_features, out_feature_class, {cluster_tolerance})
NameExplanationData Type
in_features

The input feature class or layer.

Feature Layer
erase_features

The features to be used to erase coincident features in the input.

Feature Layer
out_feature_class

The feature class that will contain only those input features that are not coincident with the erase features.

Feature Class
cluster_tolerance
(Optional)

The minimum distance separating all feature coordinates (nodes and vertices) as well as the distance a coordinate can move in x or y (or both).

Caution:

Changing this parameter's value may cause failure or unexpected results. It is recommended that you do not modify this parameter. It has been removed from view on the tool dialog box. By default, the input feature class's spatial reference x,y tolerance property is used.

Linear Unit

Code sample

Erase example 1 (Python window)

The following Python window script demonstrates how to use the Erase function in immediate mode.

import arcpy
arcpy.env.workspace = 'C:/data/gdb'
arcpy.analysis.Erase(r'redlands.gdb\rdlswells\well', 
                     r'redlands.gdb\rdlsfloodzones\flood', 
                     r'redlands.gdb\wellsoutside_flood')
Erase example 2 (stand-alone script)

Find areas of suitable vegetation that exclude areas heavily impacted by major roads.

# Name: Erase.py
# Description: Find areas of suitable vegetation that exclude areas heavily 
#              impacted by major roads

# import system modules 
import arcpy

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

# Select suitable vegetation patches from all vegetation
veg = "vegtype"
suitableVeg = "C:/output/Output.gdb/suitable_vegetation"
whereClause = "HABITAT = 1" 
arcpy.analysis.Select(veg, suitableVeg, whereClause)

# Buffer areas of impact around major roads
roads = "majorrds"
roadsBuffer = "C:/output/Output.gdb/buffer_output"
distanceField = "Distance"
dissolveField = "Distance"
arcpy.analysis.Buffer(roads, roadsBuffer, distanceField, "FULL", "ROUND", 
                      "LIST", dissolveField)

# Erase areas of impact around major roads from the suitable vegetation patches
eraseOutput = "C:/output/Output.gdb/suitable_vegetation_minus_roads"
arcpy.analysis.Erase(suitableVeg, roadsBuffer, eraseOutput)

Environments

Special cases

Parallel Processing Factor

This tool honors the Parallel Processing Factor environment. If the environment is not set (the default) or is set to 0, parallel processing will be disabled. Setting the environment to 100 will enable parallel processing. Up to 10 cores will be used when parallel processing is enabled.

Parallel processing is currently supported for polygon-on-polygon, line-on-polygon, and point-on-polygon overlay operations.

Licensing information

  • Basic: No
  • Standard: No
  • Advanced: Yes

Related topics