ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Calculate Adjacent Fields

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates fields and calculates values for the neighboring pages (polygon) of a grid polygon feature class.

The most common use case for 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

  • This tool creates eight fields whose names are a combination of the Field Name value and direction. The direction is abbreviated. For example, if the Field Name value is PageName, the new field names created by the tool would be PageName_N, PageName_NE, PageName_E, PageName_SE, PageName_S, PageName_SW, PageName_W, and PageName_NW. If the Field Name value is MyPoly, the new field names would be MyPoly_N, MyPoly_NE, MyPoly_E, MyPoly_SE, MyPoly_S, MyPoly_SW, MyPoly_W, and MyPoly_NW.

  • The tool uses default names for new fields. The field names can be altered after the tool has run.

  • You can use fields from a joined table.

Syntax

CalculateAdjacentFields(in_features, in_field)
ParameterExplanationData Type
in_features

The polygon grid index features that will be appended with adjacent field data.

Feature Layer
in_field

The field whose values will be used to populate adjacent field data.

Field

Derived Output

NameExplanationData Type
out_features

The updated feature class with adjacent field data.

Feature Layer

Code sample

CalculateAdjacentFields example (Python window)

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

import arcpy
arcpy.env.workspace = "C:\Data\ProjectData.gdb"
arcpy.CalculateAdjacentFields_cartography ("Index", "PageName")
CalculateAdjacentFields example (stand-alone 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

  • Current Workspace

Licensing information

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

Related topics

  • An overview of the Data Driven Pages toolset
  • Building map books with ArcGIS
  • What are Data Driven Pages?
  • Creating Data Driven Pages

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal