本文介绍了Android地图GPS异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Android地图API我创建的多边形,因为我从每一个第三点收集位置数据。多边形跟踪我的位置相当好。
Using the Android maps api I'm creating polygons as I collect location data from every third point. The polygons track my position fairly well.
问题是:频繁的GPS返回绕过障碍物时没有关闭远程分特
Problem is: Frequently the GPS returns points that are not remotely close especially when working around obstacles.
我如何过滤我的位置数据离群?
How can I filter my location data for outliers?
推荐答案
是GPS有一个困难时期尤其是在障碍物。输电线,建筑物等简单过滤出来。
Yes GPS has a hard time with especially around obstacles. Powerlines, buildings, etc. Simply filter them out.
@Override
public void onLocationChanged(Location location) {
if (!location.hasAccuracy()) {
return;
}
if (location.getAccuracy() > 10) {
//possibly tell user gps accuracy with transparent circle like the maps
//application does.
return;
}
//process location accurate to 10 meters here
}
这篇关于Android地图GPS异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!