Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which gps library would you recommend for python?

Tags:

python

gps

gpsd

I'm looking for a free library for python that can calculate your direction and your speed from GPS coordinates and maybe can calculate if you are in some boundaries or things like this.

Are there Libraries that you know and that worked well for you?

We are using python on a linux machine and getting the data from the gpsd. So I hope there is no need for a speciel library for only talking to the device. What I'm looking for is python code doing some basic calculations with the data. Such as comparing the last positions and calculate speed and direction.

like image 491
Janusz Avatar asked Jun 05 '09 00:06

Janusz


1 Answers

Apparently the python module that comes with gpsd is the best module to go with for us.

The gps module coming with the gpsd has some very useful functions. The first one is getting the data from gpsd and transforming those data in a usable data structure. Then the moduls give you access to your speed, and your current heading relative to north. Also included is a function for calculating the distance between two coordinates on the earth taking the spherical nature of earth into account.

The functions that are missing for our special case are:

  • Calculating the heading between to points. Means I am at point a facing north to which degree do I have to turn to face the point I want to navigate to.

  • Taking the data of the first function and our current heading to calculate a turn in degrees that we have to do to face a desired point (not a big deal because it is mostly only a subtraction)

The biggest problem for working with this library is that it is mostly a wrapper for the gpsd so if you are programming on a different OS then you gpscode should work on like Windows or MacOS you are not able to run the code or to install the module.

like image 105
Janusz Avatar answered Oct 05 '22 23:10

Janusz