ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

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
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Calculate Polygon Main Angle

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Calculates the dominant angles of input polygon features and assigns the values to a specified field in the feature class.

Usage

  • The dominant angle of a polygon is the angle of longest collection of segments that have similar orientation. This angle will be stored in the specified field in decimal degrees from true north.

  • Use this tool to determine the trend of a polygon and use the resulting angle to orient symbology such as markers or hatch lines within the polygon. This tool is meant for primarily orthogonal polygons rather than organically shaped ones.

Syntax

CalculatePolygonMainAngle_cartography (in_features, angle_field, {rotation_method})
ParameterExplanationData Type
in_features

The input polygon features.

Feature Layer
angle_field

The field that will be updated with the polygon main angle values.

Field
rotation_method
(Optional)

Controls the method and origin point of rotation.

  • GEOGRAPHIC —Angle is calculated clockwise with 0 at top/north.
  • ARITHMETIC —Angle is calculated counterclockwise with 0 at the right/east.
  • GRAPHIC —Angle is calculated counterclockwise with 0 at top/north. This is the default.
String

Code Sample

CalculatePolygonMainAngle tool example 1 (Python window)

The following Python window script demonstrates how to use the CalculatePolygonMainAngle tool in immediate mode.

import arcpy
from arcpy import env
env.workspace = "C:\data"

arcpy.CalculatePolygonMainAngle_cartography("cities", "poly_angle", "GEOGRAPHIC")
CalculatePolygonMainAngle tool example 2 (stand-alone Python script)

This stand-alone script shows an example of using the CalculatePolygonMainAngle tool.

# Name: CalculatePolygonMainAngle_standalone_script.py
# Description: calculates an angle for a polygon based on the largest edge of the feature
 
# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
in_features = "cities"
angle_field = "poly_angle"
rotation_method = "ARITHMETIC"

# Execute Calculate Polygon Main Angle
arcpy.CalculatePolygonMainAngle_cartography(in_features, angle_field, rotation_method)

Environments

  • Cartographic Coordinate System

Licensing Information

  • ArcGIS for Desktop Basic: No
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related Topics

  • An overview of the Cartographic Refinement toolset
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

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

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal