Calculate Adjacent Fields (Cartography)

License Level:BasicStandardAdvanced

Summary

The most common use case for using this tool is to populate fields that can be used to label the adjacent pages in a map book. This tool appends eight new fields (each field representing one of the eight points of the compass: North, Northeast, East, Southeast, South, Southwest, West and Northwest) to the input feature class and calculates values that identify the adjacent (neighboring) polygons, in each cardinal direction, for each feature in the input feature class.

Usage

Syntax

CalculateAdjacentFields_cartography (in_features, in_field)
ParameterExplanationData Type
in_features

Polygon grid index features to be appended with adjacent field data.

Feature Layer
in_field

Field whose values will be used to populate adjacent field data. Use actual field names. Do not use field aliases.

Field

Code Sample

CalculateAdjacentFields tool Example (Python Window)

Create and populate fields identifying adjacent features for a polygon grid feature class.

import arcpy
from arcpy import env
arcpy.env.workspace = "C:\Data\ProjectData.gdb"
arcpy.CalculateAdjacentFields_cartography ("Index", "PageName")
CalculateAdjacentFields tool Example (Stand-alone Python script)

Create and populate fields identifying adjacent features for a polygon grid feature class.

# Name: calculateadjacentfields_example.py
# Description: Create and populate fields identifying adjacent features for a
# regular polygon grid feature class
# Author: ESRI

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
arcpy.env.workspace = "C:\Data\ProjectData.gdb"

# Set local variables
inFeatures = "MyPolygonIndex"
inField = "PageName"

# Execute CalculateAdjacentFields
arcpy.CalculateAdjacentFields_cartography (inFeatures, inField)

Environments

Related Topics

Licensing Information

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