CL定位高程精度

发布于 2024-12-18 07:55:06 字数 686 浏览 1 评论 0原文

我有一个位置服务应用程序,其中提供了用户的海拔高度。但我发现 CLLocationManager 提供的高程精度极其不准确。当我两次测试相同的两个地点时,海拔差异有时是四十英尺,有时是一百英尺。有什么方法可以提高 CLLocation 的垂直精度,或者是否有不同的方法来获取用户的海拔(第三方库)?我已经尝试过检查 CLLocationManager 提供的 newLocation 的 VerticalAccuracy 属性,如果不够,则将其丢弃,但即使它足够“准确”,它通常仍然不准确。感谢您抽出时间!

现在我正在使用:

if([newLocation verticalAccuracy] < 30) {
    if(isCustomary)
        altitudeLabel.text = [NSString stringWithFormat:@"%.2f feet", ([newLocation altitude] * 3.2808399)];
    else
        altitudeLabel.text = [NSString stringWithFormat:@"%.2f meters", [newLocation altitude]];
}

该代码的问题:通常,verticalAccuracy永远不会低于30,当它低于30时,仍然不够准确;我已经在我的房子(一层)周围测试了代码,它说海拔变化最多十九英尺,我确信这不是真的。

I have a location service app, in which the user's elevation is provided. I have found, though, that the elevation accuracy provided by the CLLocationManager is extremely inaccurate. When I test the same two spots twice, sometimes the elevation difference is forty feet and sometimes it is a hundred. Is there any way that I can improve the vertical accuracy of the CLLocation, or is there a different way of acquiring the user's elevation (third-party libraries)? I have already tried checking the verticalAccuracy property of the newLocation provided by the CLLocationManager and throwing it out if it isn't sufficient, but even when it is 'accurate' enough, it still often isn't actually accurate. Thanks for your time!

Right now I'm using:

if([newLocation verticalAccuracy] < 30) {
    if(isCustomary)
        altitudeLabel.text = [NSString stringWithFormat:@"%.2f feet", ([newLocation altitude] * 3.2808399)];
    else
        altitudeLabel.text = [NSString stringWithFormat:@"%.2f meters", [newLocation altitude]];
}

Problems with that code: often the verticalAccuracy never gets below 30, and when it does, that is still not even close to accurate enough; I have tested the code walking around my house (one story), and it says the elevation changes up to nineteen feet, which I'm sure isn't true.

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

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

发布评论

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

评论(2

翻身的咸鱼 2024-12-25 07:55:06

由于几何形状,从 GPS 卫星得出的高程本质上不如 GPS 的水平解算准确。 卫星。您应该预计垂直精度通常比水平精度差约 1.5 到 3 倍。这只是 GPS 的限制,也是航空业需要 WAAS 校正才能使用 GPS 进行仪表进场的原因。

当垂直精度为 20 或 30 米时,您应该预计高度会偏离 100 英尺。当您在房子周围走动时,期望它不会变化 19 英尺是不现实的。

您可以做的是保持最近的滚动加权平均值(或卡尔曼滤波器) “良好”的高度读数有助于滤除测量误差。

The elevation derived from GPS satellites is inherently less accurate than the horizontal solution from GPS due to the geometry of the satellites. You should expect the vertical accuracy to be usually about 1.5 to 3 times worse than the horizontal accuracy. That's just a limitation of GPS and why aviation requires WAAS correction before you can use GPS for instrument approaches.

When the vertical accuracy is 20 or 30 meters you should expect the altitude to be off up to 100 feet. Expecting it to not vary by 19 feet as you walk around the house in unrealistic.

What you could do is keep a rolling, weighted average (or a Kalman filter) of the recent "good" altitude readings to help filter out the measurement errors.

时光礼记 2024-12-25 07:55:06

你尝试过什么代码?
这是最好的提升代码,所以我认为没有什么比这更好的了:

-(void)awakeFromNib {
  locmanager = [[CLLocationManager alloc] init];
  [locmanager setDelegate:self];
  [locmanager setDesiredAccuracy:kCLLocationAccuracyBest];
  [locmanager startUpdatingLocation];
}

  - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  heightMesurement.text = [NSString stringWithFormat: @"%.2f m",   newLocation.altitude];
}

  - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
  heightMesurement.text = @"0.00 m";
}

What code have you tried?
This is the best code for elevation so I don't think there is anything beyond this:

-(void)awakeFromNib {
  locmanager = [[CLLocationManager alloc] init];
  [locmanager setDelegate:self];
  [locmanager setDesiredAccuracy:kCLLocationAccuracyBest];
  [locmanager startUpdatingLocation];
}

  - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
  heightMesurement.text = [NSString stringWithFormat: @"%.2f m",   newLocation.altitude];
}

  - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
  heightMesurement.text = @"0.00 m";
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文