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
Usage
Input Feature geometries coincident with Erase Feature geometries will be removed.
The Erase Features can be point, line, or polygon as long as the Input Features 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 were single part. If multipart features are not desired, use the Multipart to Singlepart tool on the output feature class.
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 cause parallel processing to be enabled.
Syntax
arcpy.analysis.Erase(in_features, erase_features, out_feature_class, {cluster_tolerance})
Parameter | Explanation | Data 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 this parameter not be modified. It has been removed from view in the tool dialog. By default, the input feature class's spatial reference x,y tolerance property is used. | Linear Unit |
Code sample
The following Python window script demonstrates how to use the Erase function in immediate mode.
import arcpy
arcpy.env.workspace = 'C:/data/gdb'
arcpy.Erase_analysis(r'redlands.gdb\rdlswells\well',
r'redlands.gdb\rdlsfloodzones\flood',
r'redlands.gdb\wellsoutside_flood')
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.Select_analysis(veg, suitableVeg, whereClause)
# Buffer areas of impact around major roads
roads = "majorrds"
roadsBuffer = "C:/output/Output.gdb/buffer_output"
distanceField = "Distance"
dissolveField = "Distance"
arcpy.Buffer_analysis(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.Erase_analysis(suitableVeg, roadsBuffer, eraseOutput)
Environments
Licensing information
- Basic: No
- Standard: No
- Advanced: Yes