Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I calculate the angle of each polyline in ArcGIS?

share|improve this question
This is an old question, but I am wondering what you mean by "the angle of each polyline" - is it the angle of a straight line from the start to end node of that polyline, or the angle of every segment in that polyline? A picture included in your question would clarify this. – PolyGeo Sep 24 '14 at 23:56

I found a similar question on an ESRI forum that had a good answer. The image below shows a sample polyline dataset to test the field calculator on. The attached code block below calculates the degrees from the x-axis. Try the following steps:

  1. Use the Split Line at Vertices tool to create individual line segments from your poly line.
  2. Add a field in your attribute table called "angle"
  3. Right-click the "angle" field name header and open the field calculator
  4. Add the python code to the code block as in the example and click OK
  5. You may need to alter the code to meet you specific needs, but this will get you started.

enter image description here

enter image description here

share|improve this answer
You should be using atan2 – Mike T Dec 16 '12 at 20:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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