1

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?

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

tyczj
  • 71,600
  • 54
  • 194
  • 296
johnsonjp34
  • 3,139
  • 5
  • 22
  • 48
  • 1
    just check the distance between the last point, if its greater than your maximum allowed diatance just ignore it – tyczj Sep 18 '14 at 17:21

1 Answers1

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
}
danny117
  • 5,581
  • 1
  • 26
  • 35