I am trying to calculate the bearing between 2 different points - Lat1, Long1 & Lat2, Long2. I have researched many formulas and python scripts but cannot seem to accurately determine the bearing. I found that ArcGIS has a Production Mapping license which contains a tool that can do the work for me, but would rather attempt other option first.
Is there an easier way without inquiring about another license to achieve the bearing between 2 points?
is Haversine not good enough?
Haversine Formula in Python (Bearing and Distance between two GPS points) - Stack Overflow
I have implemented Vincenty's approximation
Vincenty's formulae - Wikipedia
in Python, but it isn't suitable for field calculator calculations since it is iterative. It can be used in a python ide with the user providing long/lats pairs, if you are interested? (not much market for a tool to do this) or you could construct lines and calculate the bearings yourself using
Calculate Geometry Attributes—Data Management toolbox | ArcGIS Desktop
If you're working with python PointGeometry objects, there's a method called angleAndDistanceTo that can be used to calculate the bearing from one point to the next.
Thanks for the help! I ended up using the Haversine Formula in Python which is calculating the proper bearing between stops. Now my only issue is that I need to calculate the bearing for roughly 1000 pairs of GPS points....It would be great if I could enter it into the Field Calculator, however like you said that is not possible.
Any suggestions on how to batch this process for a number of records?
Vincenty is iterative, not haversine.,
Maybe you can cobble up something with this
It was actually way faster than doing geodesic calculations using arcpy pointgeometry objects