eri*_*ell 10 geolocation core-location cllocationmanager ios altitude
我有一个位置服务应用程序,其中提供了用户的高程.但我发现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]];
}
Run Code Online (Sandbox Code Playgroud)
该代码存在问题:通常,verticalAccuracy永远不会低于30,而当它完成时,它甚至还不够准确; 我测试了在我家附近行走的代码(一个故事),它说海拔高度变化到19英尺,我确信这不是真的.
| 归档时间: |
|
| 查看次数: |
8600 次 |
| 最近记录: |