WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Establishing Direction of Travel / Bearing (Python)

Re: Establishing Direction of Travel / Bearing (Python)

by Charles Curley :: Rate this Message:

| View in Thread

On Thu, 3 Nov 2011 19:37:06 +0000
Neil Greenough <neilgreenough@...> wrote:

> I'm currently writing a script in Python which records the longitude,
> latitude and speed from the GPS device. What I'd like to do is also
> record the direction of travel / bearing for each hit (ie. North,
> South, East, West). I've tried researching this but to no avail. Any
> suggestions on how this can be implemented or does anyone have any
> examples of Python code containing bearings?

Direction of travel, or heading, and bearing are not the same thing.
Heading is the direction in which you are moving, i.e. your course
made good. Bearing is the angle from the heading to a feature.

That nitpick aside...  In C:

    if (gpsdata.set & TRACK_SET) {
        formatTrack (gpsdata.fix.track);
    }

gpsdata.fix.track is a double, and seems to be a value in the range 0 to
360, of degrees from true north, where 0 and 360 are both true north.
(To be really pedantic, it should be either 0-359 or 1-360, but I
actually prefer the extra degree.)



--

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB
_______________________________________________
Gpsd-users mailing list
Gpsd-users@...
https://lists.berlios.de/mailman/listinfo/gpsd-users

 « Return to Thread: Establishing Direction of Travel / Bearing (Python)