Pairwise Intersect (Analysis)

Summary

Computes a pairwise intersection of the input features. Features or portions of features that overlap between the input feature layers or feature classes are written to the output feature class. Pairwise intersection refers to selecting one feature from the first input and intersecting it with the features in the second input that it overlaps.

An alternate tool is available for intersect operations. See the Intersect tool documentation for details.

The Pairwise Intersect tool is similar to the Intersect 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.

Learn more about how Pairwise Intersect works

Illustration

Pairwise Intersect illustration

Usage

  • Only two input feature classes are supported.

  • 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.

  • Unlike the Intersect tool, ranks are not supported.

  • 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 relies on the input features having a spatial index. Use the Add Spatial Index tool to create an 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 Spatial reference and geoprocessing for more information.

  • 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.

Syntax

arcpy.analysis.PairwiseIntersect(in_features, out_feature_class, {join_attributes}, {cluster_tolerance}, {output_type})
ParameterExplanationData Type
in_features
[in_features,...]

The input feature classes or layers to intersect. Only two inputs are allowed.

Value Table
out_feature_class

The output feature class.

Feature Class
join_attributes
(Optional)

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

  • ALLAll the attributes from the input features will be transferred to the output feature class. This is the default.
  • NO_FIDAll the attributes except the FID from the input features will be transferred to the output feature class.
  • ONLY_FIDOnly the FID field from the input features will be transferred to the output feature class.
String
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
output_type
(Optional)

Specifies the type of intersections to be returned.

  • INPUTThe intersections returned will be the same geometry type as the input features with the lowest dimension geometry. If all inputs are polygons, the output feature class will contain polygons. If one or more of the inputs are lines and none of the inputs are points, the output will be lines. If one or more of the inputs are points, the output feature class will contain points. This is the default.
  • LINEThe intersections returned will be line. This is only valid if none of the inputs are points.
  • POINTThe intersections returned will be point. If the inputs are line or polygon, the output will be a multipoint feature class.
String

Code sample

PairwiseIntersect example 1 (Python window)

The following Python window script demonstrates how to use the PairwiseIntersect function in immediate mode:

import arcpy
arcpy.env.workspace = "C:/data/RedRiver_basin.gdb"
arcpy.PairwiseIntersect_analysis(["vegetation_stands", "road_buffer200m", "water_buffer100"], 
                                 "mysites", "ALL")
PairwiseIntersect example 2 (stand-alone script)

Find the vegetation type that the streams are traveling through.

# Name: StreamsInVegetationIntersect.py
# Purpose: Determine the vegetation type streams are traveling through.

# Import system modules
import arcpy

# Set the workspace (to avoid having to type in the full path to the data every time)
arcpy.env.workspace = "c:/data/data.gdb"    

# Process: Find all streams in each vegetation type
inFeatures = ["vegetation", "streams"]
intersectOutput = "streams_in_vegtype"

arcpy.PairwiseIntersect_analysis(inFeatures, intersectOutput)

Licensing information

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

Related topics