令人难以置信的不准确的 GPS 点.是什么原因? [英] Unbelievably inaccurate GPS points. What is the reason?

查看:20
本文介绍了令人难以置信的不准确的 GPS 点.是什么原因?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为 Android 开发了一个应用程序,用于存储用户的 GPS 位置.

I have developed an application for Android, for storing user's GPS location.

我的一位客户给了我他的设备,我注意到有时设备的准确性非常差,令人难以置信.有时设备会返回距实际位置约 200 公里的点.

One of my customers gave me his device and I noticed that sometimes the accuracy of the device is really bad and unbelievable. Sometimes the device returns points about 200 kilometers away from the actual location.

您可以在该设备的以下 GPS 位置示例中看到这一点.您会看到两个点距离真实位置大约 200 公里.

You can see this in the following GPS location samples for that device. You see that two points are about 200 km away from the real location.

设备是搭载 Android 4.2.2 的三星 SM-T111,我只使用 GPS 提供程序来获取位置 (LocationManager.GPS_PROVIDER).

The device is Samsung SM-T111 with Android 4.2.2, and I only use a GPS provider for getting locations (LocationManager.GPS_PROVIDER).

我想知道是什么导致了这种不准确的问题?

I want to know what causes the problem, for this kind of inaccuracy?

我直接存储从提供商处收到的积分.这是我在 onLocationChanged 中的代码:

I directly store the points received from the provider. This is my code in onLocationChanged:

更新

        @Override
        public void onLocationChanged(Location location) {
            try {

                    if (location.getAccuracy() <= MAX_DISTANCE_TOLERANCE) {

                        gotLocation(new GPSLocation(location.getLatitude(),
                                location.getLongitude(), location.getTime(),
                                location.getAccuracy(),
                                location.getProvider(), location.getSpeed()));
                    }               

            } catch (Exception e) {
                MessageBox.showExceptionToast(_context, e);
            }
        }

推荐答案

我想知道这种不准确的问题是什么?

I want to know what can be the problem for this kind of inaccuracy?

很可能是硬件/固件.换句话说,怪三星.

Hardware/firmware, most likely. In other words, blame Samsung.

它不太可能是您的应用.假设您获得的这些失败点的准确度值在 MAX_DISTANCE_TOLERANCE 范围内,并且假设 MAX_DISTANCE_TOLERANCE 小于 200 公里,那么您就忠实地使用了您获得的数据.如果该数据有缺陷,则这些缺陷来自系统本身.

It's unlikely to be your app. Assuming that the accuracy values that you are getting for those failed points are within MAX_DISTANCE_TOLERANCE, and assuming that MAX_DISTANCE_TOLERANCE is less than 200km, you are faithfully using the data that you get. If that data is flawed, those flaws are coming from the system itself.

您可以创建一个更具适应性的过滤器.除了测试 MAX_DISTANCE_TOLERANCE 的准确性之外,您还可以:

You could create a more adaptive filter. In addition to testing the accuracy for MAX_DISTANCE_TOLERANCE, you could:

  • 计算您获得的最后一个位置与您现在正在处理的新位置之间的时间
  • 根据您期望设备运行的某个最大速度,计算在该时间内可以覆盖的最大距离
  • 计算这两个位置之间报告的距离(Location 上有一个静态方法)
  • 拒绝报告的距离比您认为设备在这段时间内可能移动的距离更远的位置

例如,您的第一个错误修复在前一个错误修复之后 20 分钟出现.除非您认为设备可能会以 600 公里/小时的速度行驶,否则您会拒绝错误的修复,因为它不切实际.

For example, your first bad fix comes 20 minutes after the previous one. Unless you think the device might travel at 600 km/hour, you would reject the bad fix as being unrealistic.

只有在您进行了一些一致的修复后,此算法才会起作用.您可能会要求快速更新位置几分钟,检查该数据,剔除任何异常值,然后应用设备真的可以移动那么远吗?"测试未来的修复.

This algorithm will only work after you have a few consistent fixes. You might ask for rapid location updates for a few minutes, examine that data, throw out any outliers, then apply the "could the device really have travelled that far?" test for future fixes.

这篇关于令人难以置信的不准确的 GPS 点.是什么原因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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