Erase (Analysis)

License Level:BasicStandardAdvanced

Summary

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

Illustration

Erase illustration

Usage

Syntax

Erase_analysis (in_features, erase_features, out_feature_class, {cluster_tolerance})
ParameterExplanationData 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).

Linear unit

Code Sample

Erase example (Python Window)

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

import arcpy
from arcpy import env
env.workspace = "C:/data/data/gdb"
arcpy.Erase_analysis(r'redlands.gdb\rdlswells\well',r'redlands.gdb\rdlsfloodzones\flood',r'redlands.gdb\wellsoutside_flood','#')
Erase example (Stand-alone script)

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

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

# import system modules 
import arcpy
from arcpy import env

# Set environment settings
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"
xyTol = "1 Meters"
arcpy.Erase_analysis(suitableVeg, roadsBuffer, eraseOutput, xyTol)

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: No
ArcGIS for Desktop Advanced: Yes
3/3/2014