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(in_features, angle_field, {rotation_method})
Parameter | Explanation | Data 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.
| String |
Derived Output
Name | Explanation | Data Type |
out_features | The updated input polygon features. | Feature Layer |
Code sample
The following Python window script demonstrates how to use the CalculatePolygonMainAngle tool in immediate mode.
import arcpy
arcpy.env.workspace = "C:\data"
arcpy.CalculatePolygonMainAngle_cartography("cities", "poly_angle", "GEOGRAPHIC")
This stand-alone script shows an example of using the CalculatePolygonMainAngle tool.
# Name: CalculatePolygonMainAngle_standalone_script.py
# Description: Calculates the dominant angles of input polygon features and
# assigns the values to a specified field in the feature class
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:/data"
# Set local variables
in_features = "cartography.gdb/buildings_area"
angle_field = "poly_angle"
rotation_method = "ARITHMETIC"
# Execute Calculate Polygon Main Angle
arcpy.CalculatePolygonMainAngle_cartography(in_features, angle_field,
rotation_method)
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes