I'm working on ArcMap 10.3.1. I'd like to retrieve the values of all internal angles of each polygon of a shapefile, and return them as follows:

  • either concatenated on a new field;
  • or on a table;
  • or as a new points shapefile, in which each point corresponds to a vertex of each of the original polygons, with an attribute for "angle".

Whichever way I get the values for the angles is fine.

  • 1
    Don't forget to take the Tour. Unless there is already something at ArcGIS Code Sharing I think you will need to use ArcPy. For questions that involve code we ask that you show us where you are stuck with your own code by including a code snippet in your question. There is an edit button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. – PolyGeo May 1 '18 at 0:11
  • I don't think there's an out-of-the-box solution for this, you'll need to script this task.. do you have any experience in arcpy or ArcObjects? – Michael Stimson May 1 '18 at 0:55

This will do some work for polygons not sharing edges:

arcpy.FeatureVerticesToPoints_management("PGON", "./vertices.shp", "ALL")
arcpy.DeleteIdentical_management("vertices", "Shape")
arcpy.PolygonToLine_management("PGON", "./singleLine.shp")
arcpy.SplitLine_management("singleLine", "/splits.shp")
arcpy.AddGeometryAttributes_management("splits", "LINE_BEARING")

Name your vertices and assign their names to fromNode and toNode fields in splits and transfer line bearings to vertices table using join with relevant fields. Vertices below are labelled by in/out bearings: enter image description here

This field calculator expression computes internal angles:

def internalA (fr,to):
 if external<0:external+=360
 if external>360:external-=360
 return external
internalA ( !fromB!, !toB! )

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.