Tabulate Intersection (Analysis)

Summary

Computes the intersection between two feature classes and cross tabulates the area, length, or count of the intersecting features.

Illustration

Tabulate Intersection tool illustration

Usage

  • A zone is composed of all features in the Input Zone Features parameter that have the same values in the Zone Fields parameter. Similarly, a class is composed of all features in the Input Class Features parameter that have the same values in the Class Fields parameter. Features do not need to be contiguous to be in the same zone or class. This tool calculates how much of the zone is intersected by each class (area and percentage of zone area).

  • If no Class Fields value is specified, all features in the Input Class Features parameter will be considered a single class. The Output Table value will contain one record for each zone.

  • If a Class Fields value is specified, the Output Table value will contain n records for each zone in which n is the number of classes within that zone. For example, if a zone contains four classes, the Output Table value will contain four records for that zone.

  • Numeric attributes from the Input Class Features parameter can be summed by zone using the Sum Fields parameter. The sum values for a class represent a proportion of the sum values based on the percentage of the class intersecting the zone.

    Caution:

    Use fields with absolute values (not relative, normalized values such as percentages or densities) for Sum Fields, since the values may be split and apportioned to different zones.

  • Using a higher dimension Input Class Features value than the Input Zone Features value is not supported.

    • If the Input Zone Features values are points, the Input Class Features values cannot be polygons or lines.
    • If the Input Zone Features values are lines, the Input Class Features values cannot be polygons.

  • When the Input Zone Features and Input Class Features values are polygons, the output table statistics will be based on area calculations.

    When the Input Class Features values are lines, the output table statistics will be based on linear calculations.

    When the Input Class Features values are points, the output table statistics will be based on feature count.

  • When the Input Zone Features and the Input Class Features values are the same dimension (both polygon, both line, or both point), the output PERCENTAGE field records the percentage of the zone feature that is intersected by the class.

    If the Input Zone Features and the Input Class Features values are different dimensions (polygon zone with line class, polygon zone with point class, or line zone with point class), the output PERCENTAGE field records the percentage of the class intersecting the zone polygon.

    The PERCENTAGE field may record a percent value greater than 100 when there are overlapping features in the Input Zone Features or Input Class Features parameters.

  • The AREA field is included in the output table only when the Input Zone Features and Input Class Features values are polygons. The AREA field contains the area of the Input Zone Features values that the Input Class Features values intersect.

    A LENGTH field is included in the output table when the Input Class Features values are lines. The LENGTH field contains the length of intersection between the Input Zone Features and the Input Class Features values.

    A PNT_COUNT field is included in the output table when the Input Class Features values are points. The PNT_COUNT field contains the number of Input Class Features points that intersect the Input Zone Features values.

  • When using feature layers, if any features are selected, only the selected features are used in calculations.

  • Determining the intersection of zone and class features follows the same rules as the Intersect tool.

  • Use the Pivot Table tool to transform the Output Table value into a table that contains one record for each zone with class attributes as separate attribute fields. Fill in the parameters for the Pivot Table tool as follows:

    • Input TableTabulate Intersection Output Table
    • Input FieldsTabulate Intersection Zone Fields
    • Pivot FieldTabulate Intersection Class Fields
    • Value FieldTabulate Intersection Sum Fields or AREA, LENGTH, PERCENTAGE
    Example Pivot Table output

Parameters

LabelExplanationData Type
Input Zone Features

The features used to identify zones.

Feature Layer
Zone Fields

The attribute field or fields that will be used to define zones.

Field
Input Class Features

The features used to identify classes.

Feature Layer
Output Table

The table that will contain the cross tabulation of intersections between zones and classes.

Table
Class Fields
(Optional)

The attribute field or fields used to define classes.

Field
Sum Fields
(Optional)

The fields that will be summed from the Input Class Features parameter.

Field
XY Tolerance
(Optional)

The distance that determines the range in which features or their vertices are considered equal. By default, this is the x,y tolerance of the Input Zone Features parameter value.

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 Units
(Optional)

Specifies the units that will be used to calculate area or length measurements. Setting output units when the input class features are points is not supported.

  • UnknownThe units will be unknown.
  • InchesThe units will be inches.
  • FeetThe units will be feet.
  • YardsThe units will be yards.
  • MilesThe units will be miles.
  • Nautical milesThe units will be nautical miles.
  • MillimetersThe units will be millimeters.
  • CentimetersThe units will be centimeters.
  • DecimetersThe units will be decimeters.
  • MetersThe units will be meters.
  • KilometersThe units will be kilometers.
  • Decimal degreesThe units will be decimal degrees.
  • PointsThe units will be points.
  • AresThe units will be ares.
  • AcresThe units will be acres.
  • HectaresThe units will be hectares.
  • Square inchesThe units will be square inches.
  • Square feetThe units will be square feet.
  • Square yardsThe units will be square yards.
  • Square milesThe units will be square miles.
  • Square millimetersThe units will be square millimeters.
  • Square centimetersThe units will be square centimeters.
  • Square decimetersThe units will be square decimeters.
  • Square metersThe units will be square meters.
  • Square kilometersThe units will be square kilometers.
String

arcpy.analysis.TabulateIntersection(in_zone_features, zone_fields, in_class_features, out_table, {class_fields}, {sum_fields}, {xy_tolerance}, {out_units})
NameExplanationData Type
in_zone_features

The features used to identify zones.

Feature Layer
zone_fields
[zone_fields,...]

The attribute field or fields that will be used to define zones.

Field
in_class_features

The features used to identify classes.

Feature Layer
out_table

The table that will contain the cross tabulation of intersections between zones and classes.

Table
class_fields
[class_fields,...]
(Optional)

The attribute field or fields used to define classes.

Field
sum_fields
[sum_fields,...]
(Optional)

The fields that will be summed from the in_class_features parameter.

Field
xy_tolerance
(Optional)

The distance that determines the range in which features or their vertices are considered equal. By default, this is the x,y tolerance of the in_zone_features parameter value.

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
out_units
(Optional)

Specifies the units that will be used to calculate area or length measurements. Setting output units when the input class features are points is not supported.

  • UNKNOWNThe units will be unknown.
  • INCHESThe units will be inches.
  • FEETThe units will be feet.
  • YARDSThe units will be yards.
  • MILESThe units will be miles.
  • NAUTICAL_MILESThe units will be nautical miles.
  • MILLIMETERSThe units will be millimeters.
  • CENTIMETERSThe units will be centimeters.
  • DECIMETERSThe units will be decimeters.
  • METERSThe units will be meters.
  • KILOMETERSThe units will be kilometers.
  • DECIMAL_DEGREESThe units will be decimal degrees.
  • POINTSThe units will be points.
  • ARESThe units will be ares.
  • ACRESThe units will be acres.
  • HECTARESThe units will be hectares.
  • SQUARE_INCHESThe units will be square inches.
  • SQUARE_FEETThe units will be square feet.
  • SQUARE_YARDSThe units will be square yards.
  • SQUARE_MILESThe units will be square miles.
  • SQUARE_MILLIMETERSThe units will be square millimeters.
  • SQUARE_CENTIMETERSThe units will be square centimeters.
  • SQUARE_DECIMETERSThe units will be square decimeters.
  • SQUARE_METERSThe units will be square meters.
  • SQUARE_KILOMETERSThe units will be square kilometers.
String

Code sample

TabulateIntersection example 1 (Python window)

Use the TabulateIntersection function in the Python window to find the area of each vegetation type in each zone.

import arcpy
arcpy.analysis.TabulateIntersection("Zones", "zone_id", "Vegetation", 
                                    r"C:\Esri\veganalysis.gdb\vegtypeAreas", 
                                    "VEGTYPE")
TabulateIntersection example 2 (stand-alone script)

This script wraps the TabulateIntersection function to create a simple TabulateArea script tool. The TabulateArea script tool will only take polygon features as input.

The Zone and Class fields are restricted to one each.


'''
TabulateArea.py
Description: Shows how to wrap the TabulateIntersection tool to create a TabulateArea script tool
Requirements: Polygon Zone Feature Class, Polygon Class Feature Class

'''
import arcpy
import sys
import os

def AddMsgAndPrint(msg, severity=0):
    # Adds a Message (in case this is run as a tool)
    # and also prints the message to the screen (standard output)
    print(msg)

    # Split the message on \n first, so that if it's multiple lines, 
    # a GPMessage will be added for each line
    try:
        for string in msg.split('\n'):
            # Add appropriate geoprocessing message 
            if severity == 0:
                arcpy.AddMessage(string)
            elif severity == 1:
                arcpy.AddWarning(string)
            elif severity == 2:
                arcpy.AddError(string)
    except:
        pass

## Get Parameters
zoneFC = arcpy.GetParameterAsText(0)
zoneFld = arcpy.GetParameterAsText(1) # Only allow one field
classFC = arcpy.GetParameterAsText(2)
outTab = arcpy.GetParameterAsText(3)
classFld = arcpy.GetParameterAsText(4) # Optional and only allow one field
sum_Fields = ""
xy_tol = ""
outUnits = arcpy.GetParameterAsText(5)

## Validate parameters
# Inputs can only be polygons
zoneDesc = arcpy.Describe(zoneFC)
classDesc = arcpy.Describe(classFC)
if zoneDesc.shapeType != "Polygon" or classDesc.shapeType != "Polygon":
    AddMsgAndPrint("Inputs must be of type polygon.", 2)
    sys.exit()
    
# Only one zone field and class field
if zoneFld != "":
    if zoneFld.find(";") > -1 or classFld.find(";") > -1:
        AddMsgAndPrint("A maximum of one zone and/or class field is allowed.", 2)
        sys.exit()

# Run TabulateIntersection
try:
    arcpy.analysis.TabulateIntersection(zoneFC, zoneFld, classFC, outTab, 
                                        classFld, sum_Fields, xy_tol, outUnits)
except:
    arcpy.AddMessage("Tabulate Intersection Failed.")

AddMsgAndPrint(arcpy.GetMessages(), 0)

Licensing information

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

Related topics