CoreLocation的准确性测量有多准确 [英] How accurate is CoreLocation's accuracy measurement

查看:150
本文介绍了CoreLocation的准确性测量有多准确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在测试CoreLocation各个方面的准确性,并且惊讶地发现传递给CLLocationMangerDelegate方法的新旧位置提供的准确性值:(void)locationManager:didUpdateToLocation:fromLocation本身是非常不准确的。 p>

走过一段路面(沿着一条沿着一侧建筑的道路)我发现虽然CLLocationManager声称它提供的CLLocations具有5米的水平精度,实际上,MKUserAnnotation所显示的位置距离我知道的位置(通常显示为一排建筑物的相对侧)高达30米。这表明准确度读数本身并不准确。 CLLocationManager告诉我它的坐标精确到5米以内,但实际上多达30米。

为了澄清,这不是缓存/时间戳问题。它是

其他人遇到过这个问题吗?

解决方案

CoreLocation不是人类,不知道你真正在哪里,是你问题答案的本质。它正在使用设备上的传感器,并为您提供最佳答案,以及知道其声称答案的准确性的问题,这反映出位置问题本质上非常困难。

要深入了解位置数据本身:CoreLocation通过手机信号塔三角测量,附近的SSID以及最终GPS来确定设备的位置。这些确实有不同程度的准确性,但他们的共同点是,如果让设备工作更长时间,您将得到更准确的答案。但是,由于CoreLocation使用的所有工具在电池寿命方面都很昂贵,因此只要它生成的答案符合您的足够好标准,它就会停下来。

这就是为什么另一个答案告诉你设置您所需的精确度 kCLLocationAccuracyBanForNavigation - 当您做到这一点,你基本上是在告诉CoreLocation向我展示你所拥有的最好的东西,并且你也自愿提供CPU负载,时间和电池消耗。 CoreLocation使用的正常范围已经超出了常规范围,以便找出什么足够好 - 而不是提前告诉它何时可以停止,您基本上已经说过我会告诉你它什么时候足够好。

因此CoreLocation会一直试图给你更好的答案,直到你告诉它你已经完成了,并且你需要履行自己的职责来决定该点是什么。这也是您需要牢记CoreLocation的工具库中的工具的准确度有限的地方 - 您可以获取大量经纬度的有效数字,但是通过冒险缩小比例,你已经自愿为了弄清楚这些数字的可信度。预定义的精度范围是10米,100米,1公里和3公里。 CoreLocation的创建者选择这些分界点的事实应该告诉你一些关于这个问题的困难 - 如果更好的准确性很容易,它可能已经在框架中。

因此,回过头来看:CoreLocation正在忠实地报告答案的准确性,只是这些答案的基础数据存在问题,并且如果知道更多关于准确性的信息其准确性要求,它会反映在其准确性要求中。考虑一下CoreLocation准确知道其准确性声明准确程度的假设情况,然后CoreLocation不知道准确性声明的准确性,并考虑如何设计API来解决问题。 CoreLocation的确如它可以合理确定它的可靠性,并且如果你能够找到一种易处理的硬件方式来更确定你是多么确定,App Store的财富正在等待您。

I have been testing the accuracy of various aspects of CoreLocation and have been surprised to find the accuracy value supplied on new and old locations passed to the CLLocationMangerDelegate method: (void)locationManager:didUpdateToLocation:fromLocation is wildly inaccurate itself.

Walking certain stretches of pavement(along a stretch of road with buildings along one side) I have found that whilst CLLocationManager claims the CLLocations it is supplying have a horizontal accuracy of 5 meters, in actual fact the position shown by the MKUserAnnotation is anything up to 30 meters away from the position I know I'm in (often showing as being the opposite side of a row of buildings). This suggests that the accuracy reading itself is not accurate. CLLocationManager is telling me its coordinates are accurate to within 5 meters but are actually as many as 30 meters out.

To clarify, this is not a caching/timestamp issue It is repeatable in certain areas, and not something that improves over time.

Has anyone else encountered this issue?

解决方案

CoreLocation is not a human and does not know where you "really" are, is the essence of the answer to your question. It is using the sensors on your device and giving you the best answer it's got, and the problems with its ability to know the accuracy of its claimed answer, reflect that the problem of location is inherently very difficult.

To digress into the location data itself: CoreLocation draws from cell tower triangulation, nearby SSIDs, and finally GPS, to determine the device's location. These do have varying degrees of accuracy, but what they have in common is that if you let the device work for longer, you'll get a more accurate answer. However, because all of the tools that CoreLocation uses are expensive in terms of battery life, it will stop as soon as it has generated an answer that meets your criteria for "good enough."

This is why another answer told you to set your desiredAccuracy to kCLLocationAccuracyBestForNavigation - when you do that, you're basically telling CoreLocation "show me the best you've got," and you've also volunteered for the CPU load, time, and battery drain that come with that. You've also gone off the normal scale that CoreLocation uses to figure out what's "good enough" - instead of telling it ahead of time when it can stop, you've basically said "I'll tell you when it's good enough."

CoreLocation will thus keep on trying to give you better answers until you tell it you're done, and you need to carry out your responsibility for deciding what that point is. This is also where you need to bear in mind that there are limits to how accurate the tools in CoreLocation's repertoire can be - you can get lots of significant digits of latitude and longitude, but by venturing off the scale, you've volunteered for the task of figuring out how trustworthy those numbers are. The pre-defined scales of accuracy are 10 meters, 100 meters, 1 km, and 3km. The fact that the creators of CoreLocation chose those cut-off points should tell you something about the difficulty of the problem - if better accuracy were easy, it would probably already be in the framework.

So circling back around: CoreLocation is reporting the accuracy of its answers faithfully, it's just that the data underlying those answer is problematic, and if it knew more about the accuracy of its accuracy claims, it would reflect that in its accuracy claims. Consider the hypothetical situation where CoreLocation knows exactly how accurate its accuracy claims are, then the situation where CoreLocation knows nothing about how accurate its accuracy claims are, and consider how you'd design an API to account for the problem. CoreLocation is as sure as it can reasonably be about how sure it is, and if you can figure out a tractable-within-the-limits-of-the-hardware way to be more sure about how sure you are, App Store wealth awaits you.

这篇关于CoreLocation的准确性测量有多准确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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