Android Maps GPS outlier

无人久伴 提交于 2020-01-15 11:28:06

问题


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.

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?


回答1:


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
}


来源:https://stackoverflow.com/questions/25918724/android-maps-gps-outlier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!