2014-09-18 25 views
1

使用Android地图API我创建多边形,因为我从每个第三点收集位置数据。多边形相当好地追踪我的位置。Android Maps GPS离群值

问题是:GPS常常返回不是远程关闭的点,特别是在障碍物周围工作时。

如何过滤我的位置数据以确定异常值?

You can kind of see that I don't want to include the outliers in my third points.

+1

只是检查最后一点之间的距离,如果它大于你允许的最大距离就忽略它 – tyczj 2014-09-18 17:21:09

回答

1

是GPS有一个困难时期特别是围绕障碍。电力线,建筑物等简单地过滤出来。

@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 
}