你会推荐哪种gps库用于python? [英] Which gps library would you recommend for python?

查看:174
本文介绍了你会推荐哪种gps库用于python?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个免费的python库,可以根据GPS坐标计算出您的方向和速度,也可以计算出您是否处于某种边界或类似的情况。



您知道哪些图书馆适合您吗?

编辑:好吧,似乎我必须指出这一点。我们在Linux机器上使用python并从gpsd获取数据。所以我希望没有必要只与设备交谈的专用库。我正在寻找的是Python代码与数据做一些基本的计算。例如比较最后的位置并计算速度和方向。显然,带有gpsd的python模块是最好的模块,跟我们一起去吧。
一开始看 here (站点重定向到垃圾邮件)。



gpsd附带的gps模块具有一些非常有用的功能。第一个是从gpsd获取数据并将这些数据转换为可用的数据结构。
然后模块可以让您访问您的速度,以及您当前的标题相对于北方。
还包括一个函数,用于计算地球上两个坐标之间的距离并考虑地球的球面特性。



我们特殊情况下缺少的函数是:


  • 计算点之间的标题。意思是我面向北方,我必须转向哪个程度去面对我想要导航的点。

  • 将第一个函数和我们当前的标题的数据计算出我们必须做的面向所需点的转角(不是大问题)因为它大多只有一个减法)


    使用这个库的最大问题是它主要是一个包装器对于gpsd,所以如果您在不同的操作系统上编程,那么您的gpscode应该像Windows或MacOS一样工作,您无法运行代码或安装模块。


    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?

    Edit: Ok it seems I have to specify this a little bit. 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.

    解决方案

    Apparently the python module that comes with gpsd is the best module to go with for us. For a start look here (site redirects to spam).

    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.

    这篇关于你会推荐哪种gps库用于python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆