Polygon Neighbors (Analysis)

License Level:BasicStandardAdvanced

Summary

Creates a table with statistics based on polygon contiguity (overlaps, coincident edges, or nodes).

Learn more about how Polygon Neighbors works

Illustration

Diagram showing a source polygon and its neighbor polygons

Usage

Syntax

PolygonNeighbors_analysis (in_features, out_table, {in_fields}, {area_overlap}, {both_sides}, {cluster_tolerance}, {out_linear_units}, {out_area_units})
ParameterExplanationData Type
in_features

The input polygon features.

Feature Layer
out_table

The output table.

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

Input attribute field or fields used to identify unique polygons or polygon groups and represent them in the output.

Field
area_overlap
(Optional)

Determines if overlapping polygons will be analyzed and reported in the output.

  • NO_AREA_OVERLAPOverlapping relationships will not be analyzed and included in the output. This is the default.
  • AREA_OVERLAPOverlapping relationships will be analyzed and included in the output.
Boolean
both_sides
(Optional)

Determines if both sides of neighbor relationships will be included in the output.

  • BOTH_SIDES For a pair of neighboring polygons, report both neighboring information of one polygon being the source and the other being the neighbor and vice versa. This is the default.
  • NO_BOTH_SIDES For a pair of neighboring polygons, only report neighboring information of one polygon being the source and the other being the neighbor. Do not include the reciprocal relationship.
Boolean
cluster_tolerance
(Optional)

The minimum distance between coordinates before they are considered equal. By default, this is the XY Tolerance of the input features.

Linear unit
out_linear_units
(Optional)

Units used to report the total length of the coincident edge between neighboring polygons. The default is the input feature units.

String
out_area_units
(Optional)

Units used to report the area overlap of neighboring polygons. The default is the input feature units. This parameter is only enabled when the area_overlap parameter is set to AREA_OVERLAP.

String

Code Sample

PolygonNeighbors example (Python window)

Find each electoral districts neighbors in the province of Nova Scotia.

import arcpy, sys

arcpy.env.overwriteOutput = True

arcpy.MakeFeatureLayer_management(r"C:\Data\Canada\CanadaElecDist.shp",r"Canada_ElectoralDist")

arcpy.SelectLayerByAttribute_management(r"Canada_ElectoralDist", "NEW_SELECTION", "\"PROVCODE\" = 'NS'")
print "Selected feature count: " + str(arcpy.GetCount_management(r"Canada_ElectoralDist"))

arcpy.PolygonNeighbors_analysis(r"Canada_ElectoralDist", "ENNAME", r"C:\Data\Output\NS_elec_neigh.dbf")
print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
3/3/2014