iPhone GPS 精度 - 即使设备静止,读数也会变化

发布于 2024-12-07 15:37:45 字数 191 浏览 0 评论 0原文

我正在开发一个应用程序,旨在计算从起点到终点的行驶距离。 我已完成所有操作来获取不断变化的坐标并测量该坐标之间的距离。 现在真正的问题是,即使我在几秒钟后保持 iPhone 静止,GPS 读数也会显示偏差,并且 CLLocationDistance 告诉我我已经移动了几百米,而我也没有移动一点。 我可以做些什么来提高我的应用程序的精度吗?

提前致谢。

I am working on an app that is meant to calculate the distance traveled from starting point to end.
i have done all things to get the changing coordinates and measure the distance between this co-ordinates.
Now the real problem is even though if I keep my iPhone stationary after few seconds the GPS readings shows deviation and CLLocationDistance tells me that I had moved few 100 meters whereas I haven't moved a bit also.
Is there anything I can do increase the precision of my app ??

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

中性美 2024-12-14 15:37:45

iPhone 上的 GPS 会长时间工作以节省电池电量。第一组坐标将是手机最后知道的坐标。
根据您想要的精度,它会尝试获得更好的修复,首先会在 wifi 或手机信号塔上使用三角测量。

一段时间后,GPS 信号就会通过并为您提供更精确的位置,只有在您告诉它或达到所需的精度时,iOS 才会停止更新。

您可以做的是检查收到的职位的准确性,看看它是否符合您的标准。
没有办法立即获得最多的修复,这只是需要一些时间。

The GPS on the iPhone works in away to preserve battery. The first set of coordinates will be the last know coordinates of the phone.
And depending on the accuracy you desire it will try and get a better fix, first will use triangulation on wifi or cell towers.

After a while the GPS signal come thru and gives you a more precise position and the iOS will only stop update if you tell it to or if the desired accuracy is met.

What you can do is check the accuracy of the postion received and see if it meets you criteria.
There is no way to just get the most accrued fix wright away, it's just going to take some time.

故人爱我别走 2024-12-14 15:37:45

无法提高应用程序中 GPS 的精度,但您可以提高结果的准确性。

首先,尝试使用 CLLocationManger 的 distanceFilter。

/*
 *  distanceFilter
 *  
 *  Discussion:
 *      Specifies the minimum update distance in meters. Client will not be notified of movements of less 
 *      than the stated value, unless the accuracy has improved. Pass in kCLDistanceFilterNone to be 
 *      notified of all movements. By default, kCLDistanceFilterNone is used.
 */
@property(assign, nonatomic) CLLocationDistance distanceFilter;

还有您想要的准确性

/*
 *  desiredAccuracy
 *  
 *  Discussion:
 *      The desired location accuracy. The location service will try its best to achieve
 *      your desired accuracy. However, it is not guaranteed. To optimize
 *      power performance, be sure to specify an appropriate accuracy for your usage scenario (eg,
 *      use a large accuracy value when only a coarse location is needed). Use kCLLocationAccuracyBest to
 *      achieve the best possible accuracy. Use kCLLocationAccuracyBestForNavigation for navigation.
 *      By default, kCLLocationAccuracyBest is used.
 */
@property(assign, nonatomic) CLLocationAccuracy desiredAccuracy;

最后,您应该考虑检索到的位置更新的准确性。根据准确性丢弃无效数量的位置更新是摆脱那些不太有效的位置的好方法。但也要注意,获得真正良好的 GPS 精度信号需要一些时间。

There is no way to improve the precision of your GPS within your app, but you can improve the accuracy of the results.

First of all, try playing with the distanceFilter of your CLLocationManger.

/*
 *  distanceFilter
 *  
 *  Discussion:
 *      Specifies the minimum update distance in meters. Client will not be notified of movements of less 
 *      than the stated value, unless the accuracy has improved. Pass in kCLDistanceFilterNone to be 
 *      notified of all movements. By default, kCLDistanceFilterNone is used.
 */
@property(assign, nonatomic) CLLocationDistance distanceFilter;

Also your desired accuracy

/*
 *  desiredAccuracy
 *  
 *  Discussion:
 *      The desired location accuracy. The location service will try its best to achieve
 *      your desired accuracy. However, it is not guaranteed. To optimize
 *      power performance, be sure to specify an appropriate accuracy for your usage scenario (eg,
 *      use a large accuracy value when only a coarse location is needed). Use kCLLocationAccuracyBest to
 *      achieve the best possible accuracy. Use kCLLocationAccuracyBestForNavigation for navigation.
 *      By default, kCLLocationAccuracyBest is used.
 */
@property(assign, nonatomic) CLLocationAccuracy desiredAccuracy;

And last, you should be playing with the accuracy of the location updates retrieved. Discarding an invalid amount of location updates based on their accuracy is a good way to get rid of those not-so-valid locations. But also be aware that it will take some time to get a real nice gps accuracy signal.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文