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 will be 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 tool illustration

Usage

  • Only two input feature classes are supported.

  • The input must be simple features, such as point, multipoint, line, or polygon features. You cannot use complex features such as annotation features, dimension features, or network features.

  • If the inputs have different geometry types, the output geometry type will default to the lowest dimension of the inputs.

    • If an input is point features, the default output will be point features.
    • If an input is line features, and there are no inputs with point features, the default output will be line features.
    • If all inputs are polygon features, the default output will be polygon features.

  • The Output Type parameter value can be that of the Input Features parameter value with the lowest dimension geometry or lower. For example, if all the inputs are polygons, the output can be polygon, line, or point. If one of the inputs is of type line and none are points, the output can be line or point. If any of the inputs are point, the Output Type value can only be point.

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

  • All inputs must have 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 possibility that it is incorrect.

  • When the 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. If the environment is set to 0, parallel processing will not be enabled. If a factor between 1 and 99 is specified, the tool will 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.

Parameters

LabelExplanationData Type
Input Features

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

Value Table
Output Feature Class

The output feature class.

Feature Class
Join Attributes
(Optional)

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

  • All attributesAll the attributes from the input features will be transferred to the output feature class. This is the default.
  • All attributes except feature IDsAll the attributes except the FID from the input features will be transferred to the output feature class.
  • Only feature IDsOnly the FID field from the input features will be transferred to the output feature class.
String
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
Output Type
(Optional)

Specifies the type of intersections that will be returned.

  • Same as 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

arcpy.analysis.PairwiseIntersect(in_features, out_feature_class, {join_attributes}, {cluster_tolerance}, {output_type})
NameExplanationData 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)

Specifies 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 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
output_type
(Optional)

Specifies the type of intersections that will 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.analysis.PairwiseIntersect(["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.analysis.PairwiseIntersect(inFeatures, intersectOutput)

Licensing information

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

Related topics