从 GPS 坐标计算平均速度的最佳实践 [英] Best practice to calculate the average speed from GPS coordinates

查看:28
本文介绍了从 GPS 坐标计算平均速度的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我这里有一个可以给我 GPS 坐标的设备.我可以定义的时间间隔.我想用它来计算开车或开车旅行时的平均速度.实际上我使用了一个orthodrome公式来计算两点之间的距离,然后除以给定的时间间隔.通过实施,我遵循了这个术语.不幸的是,我只能找到德语链接,但我认为该公式应该可以用任何语言理解 ;)

I have here a device which can give me GPS coordinates. The time interval I can define. I want to use it to calculate the average speed during driving or travelling by car. Actually I used a orthodrome formula to calculate the distance between two points and then divided it by the given time interval. By the implementation I followed this term. Unfortunately I could only find a German link, but I think the formula should be understandable in any language ;)

不幸的是,使用此公式和 1 秒的时间间隔会得出非常不精确的结果.行走时的速度在 1 公里/小时到 20 公里/小时之间.

Unfortunately, using this formula and a time interval of 1 second gives very unprecise results. The speed while walking is between 1 km/h and 20 km/h.

所以我想知道是否有关于如何实现两个 GPS 坐标之间的距离计算的一般参考(我在 SO 上发现了类似的东西),特别是更新 GPS 坐标的最佳时间间隔是什么?

So I wonder if there is a general reference on how to implement distance calculation between two GPS coordinates (I found something similar on SO) and particulary, which is the best time interval to update the GPS coordinates?

推荐答案

我假设您通过以恒定速度步行(我认为 ~5 kph 是正常步行速度)同时测量一次 GPS 位置来测试这一点第二.

I assume that you're testing this by walking at a constant speed (I think ~5 kph is a normal walking speed) while measuring your GPS position once per second.

您看到的瞬时速度变化(每个测量点之间的距离除以 1 秒)要么是由于测量的 GPS 位置的随机变化造成的,要么是您没有准确测量/em> 相隔一秒(或者可能是这两种情况).

The variation that you're seeing in instantaneous speed (the distance between each measured point divided by 1 second) is either due to random variation in the measured GPS position or else you aren't taking your measurements exactly one second apart (or it could be both of these things).

我将假设您的测量值被精确地间隔一秒钟.手持式 GPS 设备远不如宣传的那样准确.虽然人们经常声称这些设备精确到真实位置 10 英尺以内,但事实并非如此.

I'm going to assume your measurements are being taken precisely one second apart. Hand-held GPS devices are much less accurate than advertised. While it's often claimed that the devices are accurate to within 10 ft. of the true position, this simply isn't so.

测量和报告 GPS 设备精度的最佳方法是将其放置在可以看到卫星且不会被雨淋的地方,并记录几天的数据.然后,您可以使用 Google 地图绘制这些点 - 我已经在我家周围和办公室周围进行了绘制,这是一种让您了解比例的好方法.

The best way to measure and report the accuracy of a GPS device is to leave it in a place where it can see the satellites and not be rained on, and record a few day's worth of data. You can then use Google Maps to plot the points - I've done this around my house and around the office, which is a good way to give you a sense of scale.

显然,如果设备非常准确,您会在一个位置看到所有测量点.或者,如果 10 英尺的精度是真的,你会在一个 20 英尺直径的圆内看到一个小簇中的所有点.

Obviously, if the devices were perfectly accurate, you would see all your measured points in one spot. Or, if the 10 ft. accuracy thing were true, you would see all the points in a little cluster inside a 20 ft. diameter circle.

您所看到的(对于我测试过的每个支持 GPS 的设备)是由几秒钟的范围内发生的相对较小的位置散射(大约几十英尺)和平均位置的长期随机游走",可能在一两天内移动 200 或 300 英尺.例如,当绘制在您自己的房子上时,您的 PDA 可能看起来像是徘徊到邻居的房子,然后穿过街道,然后沿着街道两栋房子,回到您身边等等,同时在这里抖动大约 5 或 10 英尺或者喜欢喝太多咖啡.

What you see instead (with every GPS-enabled device I've ever tested) is a combination of relatively small positional scattering (on the order of a few tens of feet) occurring on a scale of a few seconds, and a longer-term "random walk" of the average position which might move 200 or 300 ft. in the course of a day or two. When plotted over your own house, for example, it might look like your PDA wandered over to the neighbor's house, then across the street, then down the street two houses, back towards you etc., all while jittering around 5 or 10 feet here or there like it drank too much coffee.

GPS 可以比这更准确.测量员使用具有更强大接收器的设备(因此他们可以更准确地读取卫星信号),并且他们将它们一次放置数天以平均连续测量.手持设备拥有廉价的接收芯片和廉价的天线,无论如何都要应对各种信号干扰.

GPS can be more accurate than this. Surveyors use devices with much more powerful receiver sets (so they get a much more accurate read on the satellite signals), and they leave them in place for days at a time to average successive measurements. Handheld devices have cheap receiver chips and cheap antennas and have to deal with all kinds of signal interference anyway.

最好的办法是做一个运行平均值来计算你的瞬时速度.不是将当前点和前一点之间的距离除以 1 秒,而是取点之间的最后 5 个距离并除以 5 秒(或您使用的任何秒数).重要的是,不要只是将当前点与 5 秒前的点之间的差值除以 5,否则会错过任何非线性运动.

Your best bet is to do a running average to calculate your instantaneous speed. Instead of dividing the distance between the current point and the previous point by 1 second, take the last 5 distances between points and divide by 5 seconds (or whatever number of seconds you use). It's important not to just take the difference between the current point and the point 5 seconds ago and divide this distance by 5, as that would miss any non-linear movement.

更新:我在评论中注意到您使用的是 Android 设备.你知道它是否有内置 GPS 接收器吗?许多(大多数?)Android 设备没有,这意味着它们的 GPS 不是 GPS 的三角测量版本,而是基于来自信号的猜测我在哪里-细胞塔版本.这在位置上要准确得多,我相信你可以从我描述的刻薄中看出.:)

Update: I noticed in a comment that you're using an Android device. Do you know if it has a built-in GPS receiver? Many (most?) Android devices don't, which means their GPS is not the triangulate-on-the-satellites version of GPS, but the guess-where-I-am-based-on-the-signal-from-the-cell-towers version. This is much less accurate positionally, as I'm sure you could tell from the snarkiness of my description. :)

这篇关于从 GPS 坐标计算平均速度的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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