HOW TO
In ArcGIS Pro, directions of line features can be determined by the compass direction. This is important to show the cardinal and ordinal directions used for navigation and geographic orientation.
This article describes the workflow to determine the compass direction of line features in ArcGIS Pro.
Note: The Case Field is used to group features for separate linear directional mean computations. When a Case Field is specified, the input line features are first grouped according to case field values, then an output line feature is created for each group. The case field can be of integer, date, or string type. Records with NULL values for the Case Field are excluded from analysis.
direction(!CompassA!)
Note: The following script defines the direction based on the north of the map. The line continues to take into account the north of the map even if it is tilted.
def direction(var):
if var < 22.5:
return "North"
if var >= 22.5 and var < 67.5:
return "Northeast"
if var >= 67.5 and var < 112.5:
return "East"
if var >= 112.5 and var < 157.5:
return "Southeast"
if var >= 157.5 and var < 202.5:
return "South"
if var >= 202.5 and var < 247.5:
return "Southwest"
if var >= 247.5 and var < 292.5:
return "West"
if var >= 292.5 and var < 337.5:
return "Northwest"
if var >= 337.5:
return "North"
The direction of the line features are displayed in the attribute table as shown in the image below.
Get help from ArcGIS experts
Download the Esri Support App