2013-05-30 38 views
0

我正在与GPS相关的应用程序,我需要得到垂直精度,但它总是修复11.0000我需要它动态作为纬度和经度,我用getAccuracy,但它导致水平精度。垂直精度在Android GPS GPS

@Override 
public void onLocationChanged(Location location) 
{ 
if (location != null) 
{ 
lat = location.getLatitude(); 
lon = location.getLongitude(); 
Geocoder geoCoder = new Geocoder(getBaseContext(), 
Locale.getDefault()); 
address = mailOb.getAddress(geoCoder, lat, lon); 

if (!meterFootFlag) 
{ 
diameter = Math.round(location.getAccuracy()) + " m."; 
altitude = Math.round(location.getAltitude()) + " m."; 

} 
else 
{ 
diameter = Math.round(location.getAccuracy() * 3.28084) 
+ " ft."; 
altitude = Math.round(location.getAltitude() * 3.28084) 
+ " ft."; 

} 

if (diameter.contains("+")) 
diameter.replace("+", ""); 
else if (altitude.contains("+")) 
altitude.replace("+", ""); 
} 
else 
{ 
lat = 0.0; 
lon = 0.0; 

if (!meterFootFlag) 
{ 
altitude = 0.0 + " m."; 
diameter = 0.0 + " m."; 

} 
else 
{ 
altitude = 0.0 + " ft."; 
diameter = 0.0 + " ft."; 

} 
} 
mlocManager.removeUpdates(MySettings.this); 
pDialog.dismiss(); 

我怎样才能得到它垂直精度提前

感谢

回答

3

Android不提供垂直精度。
垂直精度通常比水平精度差2-3倍。

一个简单的解决方案:使用横向和纵向的androids精度。

先进的解决方案1:找出Android使用的总精度(这可能是一个错误,球的径向误差,包括纬度,经度和海拔高度)

尝试找出一个转换因子,例如取准确性和乘数2,5

另一种解决方案,看看iphone的水平和垂直精度,并与android的比较。找出acc到vert acc的平均换算系数。

解决方案3:想想你为什么需要垂直精度。你为什么需要这个?

提示:从我的iphone4的例子:当iPhone显示30米HOR,我有57vert,10hor:15-20vert,5霍尔,10vert

+0

那么在这种情况下有什么选择?我要离开去使用它吗?或者我可以使用其他任何东西,然后呢? – Yagnesh

+0

我更新了我的amswer – AlexWien

+0

@Yug是我的答案有用吗?考虑也upvoting。 – AlexWien

1

高度精度在很大程度上取决于核心GPS精度,使用额外的传感器作为晴雨表并使用wifi/cell网络加上融合算法。它没有一个恒定的比例。如果你真的想要得到准确性,你可以尝试以下方法:在静止的时候检查信号的变化,这不会总是有效的,因为有些设备会检测到静止,只是重复上次输出以节省功耗。另一种成本较高的方法是参考https://developers.google.com/maps/documentation/elevation/intro ,所以你基本上采用经纬度测量和纬度误差,并检查垂直误差,假设你处于空旷区域。