How to get heading from coordinates #831
Unanswered
kokobegalo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm a novice when it comes to cartography, so please have forbearance with this probably elementary question.
I want to calculate a heading (compass course), given two points defined by their latitude/longitude values. I found two potential ways of doing it, given the functionality available in pyproj. The following code illustrates this:
Unfortunately, the two approaches produce results that differ by about one degree:
$ python3 headingTst.py
heading_utm = 326.865
heading_geod = 327.816
Obviously, one of these methods (or even both) is unsuitable for the purpose. I'd like to understand why there is a difference, and which method is the better one. If neither is good, then what should I do instead?
The ultimate purpose of this is to find a method of verifying whether the heading data reported by a dGPS system is sufficiently accurate. The system measures position data and heading data, using two fundamentally different methods. The position measurement is done in the usual GPS way, based on time differences between signals from a number of GPS satellites. The heading measurement is based on a phase difference measurement, at two separate antennas, on the GPS carrier wave (we don't know any details beyond that). Our experience is that the position measurement is more reliable than the heading measurement. The heading is vital when converting latitude/longitude data into distances in meters in a coordinate system that is co-located with the vehicle in which the dGPS unit is installed.
Beta Was this translation helpful? Give feedback.
All reactions