0

Is there a way we can calculate or when rotating polygons, actualize/update our "Angle" field in the attribute table by using Python? There is a tool in ArcGIS "calculate Polygon Main Angle" but is not supported by ArcGIS Basic license.

My code that works only in Standard license is:

import arcpy
from arcpy import env
import os

polygons = arcpy.GetParameterAsText(0)
angle_field = "Angle"
rotation_method = "GEOGRAPHIC"

arcpy.CalculatePolygonMainAngle_cartography(polygons, angle_field, 
rotation_method)

Any hint ?

  • I have regular rectangels – gisgis Aug 24 at 18:50
  • 2
    Minimum Bounding tool does it, see options. – FelixIP Aug 24 at 20:19
  • the think is that i get an orientation angle but it cant be used anymore by data driven pages as rotation angle you can use it but it doesnt fit in my map frame i hope you know what i mean but thank you anyways – gisgis Aug 25 at 16:33
  • No sorry, I don't understand, why can't it be used by DDP? Once you have the angle from the minimum bounding, what if you forget DDP and just loop through your index features and set the dataframe properties using python (desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/…)? – RGfromRWBJV Aug 26 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.