Count Overlapping Features (Analysis)

Summary

Generates planarized overlapping features from the input features. The count of overlapping features is written to the output features.

Illustration

Count Overlapping Features illustration

Usage

  • The geometry type of the output is the same as the geometry type of the input, with the exception of point geometry. For point geometry, the output will be a multipoint feature class if there are multiple input feature classes or a point feature class if there is a single input point feature class.

  • The output is a planarized union of the inputs. Overlap between vertically offset features (geometry with various z-values) is evaluated as if all features are flattened onto the same plane.

    For polygon geometry, any area that is occupied by two or more features is considered an overlap. For line geometry, only lines that overlap completely (a line segment is incident with another line segment) are considered overlapping. Lines that intersect at a point are not considered overlapping. For point geometry, any coincident points are considered overlapping.

  • The following fields will be included in the Output Feature Class:

    • COUNT_—The number of overlapping features in the input
    • COUNT_FC—The number of individual feature classes that overlap the feature

    All other fields from the Input Features are excluded from the Output Feature Class.

  • When an Output Overlap Table is generated, it includes one record for each overlap. For example, when three input features overlap the same location, the table contains three records for that location-one for each overlapping geometry. The following fields are included with the Output Overlap Table:

    • OVERLAP_OID—The ObjectID of the related Output Feature Class feature.
    • ORIG_OID—The ObjectID of the related Input Features feature.
    • ORIG_NAME—This field will be added if there are multiple inputs. The field contains the name of the input.

    This table allows you to relate each overlap back to the input and output features.

Parameters

LabelExplanationData Type
Input Features

The input feature classes or layers. The input features can be point, multipoint, line, or polygon. If multiple inputs are provided, they must all be the same geometry type.

Feature Layer
Output Feature Class

The output feature class containing the overlap count.

Feature Class
Minimum Overlap Count
(Optional)

Limits the output to only locations that meet or exceed the specified number of overlaps. The default value is 1.

Long
Output Overlap Table
(Optional)

The output table containing records for each individual overlapping geometry.

Table

arcpy.analysis.CountOverlappingFeatures(in_features, out_feature_class, {min_overlap_count}, {out_overlap_table})
NameExplanationData Type
in_features
[in_features,...]

The input feature classes or layers. The input features can be point, multipoint, line, or polygon. If multiple inputs are provided, they must all be the same geometry type.

Feature Layer
out_feature_class

The output feature class containing the overlap count.

Feature Class
min_overlap_count
(Optional)

Limits the output to only locations that meet or exceed the specified number of overlaps. The default value is 1.

Long
out_overlap_table
(Optional)

The output table containing records for each individual overlapping geometry.

Table

Code sample

CountOverlappingFeatures example (Python window)

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

import arcpy
arcpy.env.workspace = r"C:\data\data.gdb"
arcpy.analysis.CountOverlappingFeatures("Viewsheds", "Viewshed_Overlaps")
CountOverlappingFeatures example 2 (stand-alone script)

The following code demonstrates how to use the CountOverlappingFeatures function to get the overlap count for three overlapping cellular service provider networks and use the min_overlap_count parameter to limit the output to only those areas where all three cellular service providers have coverage.

# CountOverlappingFeatures_Example_2.py
# Description: Count number of cellular service providers for given area

# Import the system modules
import arcpy

# Set current workspace
arcpy.env.workspace = r"C:\data\data.gdb"

# Set input parameters
provider_a = 'Provider_A_ServiceArea'
provider_b = 'Provider_B_ServiceArea'
provider_c = 'Provider_C_ServiceArea'
in_fcs  = [provider_a, provider_b, provider_c]

# Set output feature names
out_fc = 'CellularProviders_Count'
out_tbl = 'CellularProviders_Count_Tbl'

# Obtain overlap count for three overlapping input feature classes
# and use minimum_overlap_count parameter to limit the output to only 
# those areas where all three overlap.
arcpy.analysis.CountOverlappingFeatures(in_fcs, out_fc, 3, out_tbl)

Licensing information

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

Related topics