Pairwise Erase (Analysis)

Summary

Computes a pairwise intersection of the input and erase features. Only those portions of the input features falling outside the erase features will be copied to the output feature class.

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

Illustration

Pairwise Erase illustration

Usage

  • 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, and a point erase feature can be used to erase points from the input features.

    The Input Features parameter value must be simple features: point, multipoint, line, or polygon. They cannot be complex features such as annotation features, dimension features, or network 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.

  • Input curve features will be densified in the output.

  • This tool relies on the input features having a spatial index. Use the Add Spatial Index tool to create a new index (particularly for shapefiles) or rebuild an existing index if there is any doubt about it being correct.

  • When your input features have m- or z-values, only the m- and z-values of the first feature class will be transferred to the output features. If the first feature class does not contain m- or z-values, the output will not contain m- or z-values.

  • The spatial reference of the output feature class will be that of the first feature class in the Input Features parameter. See the topic Spatial reference and geoprocessing for more information.

  • By default, curve features from the input will be densified in the output. To support curves in the output, use the Maintain Curve Segments environment.

  • This tool honors the Parallel Processing Factor environment. If the environment is not set (the default) or is set to 100, full parallel processing will be enabled and the tool will attempt to distribute the work to all the logical cores on the machine. Setting the environment to 0 will disable parallel processing. Specifying a factor between 1 and 99 will cause the tool to identify the percentage of logical cores to use by applying the formula (Parallel Processing Factor / 100 * Logical Cores) rounded up to the nearest integer. If the result of this formula is 0 or 1, parallel processing will not be enabled.

  • The Pairwise Erase tool is similar to the Erase tool in that geometric intersections are computed, but it is different in that intersections are computed on pairs of features rather than all combinations of features. This tool is efficient in situations in which the input or erase feature classes contain large numbers of densely packed features.

Syntax

arcpy.analysis.PairwiseErase(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 output feature class.

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

PairwiseErase example 1 (Python window)

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

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

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

# Name: PairwiseErase.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.PairwiseErase_analysis(suitableVeg, roadsBuffer, eraseOutput)

Licensing information

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

Related topics