ArcGIS Desktop

  • Documentation
  • Support

  • 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

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

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

  • You cannot specify names for the new fields. The tool uses default names, though you can change field names after the tool has been run.

  • You can use fields from a joined table.

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

  • Current Workspace

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop 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
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2017 Esri. | Privacy | Legal