2014-09-18 43 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 
}