Question

I've a GPS tracker that now works great, except when iPhone lost GPS connection. When the connection is lost, the track makes one or more points to a random location, as you can see in this image:

track
(source: alluneed.it)

In which way can I discard these bad values? I've thought about doing it this way: before save my data, I can do a sum of my integer values of current latitude and longitude and compare with integer values of my old latitude and longitude; if the difference is bigger than some value, I discard my data.

Will it be a good thing? Are there some other nice tricks to do this?

Was it helpful?

Solution

maybe i've found my fault:

in

locationManager:didFailWithError:

when i receive a kCLErrorNetwork or any other error except kCLErrorDenied i perform a stopupdatinglocation and a startupdatinglocation.

Now the app works good, i make some other test tomorrow and post here the result.

OTHER TIPS

Try to check the time of the location update while the GPS has no signal (the time is provided within the location parameter if I recall correctly).

Maybe the time is some constant , and that way you can check if the difference between the current time and the location time is more then some value, to know if the location is real or not.

You can sanity check points before using them. If the accuracy level suddenly jumps up and then back down again, you can throw away that one point. If the timestamp says the user is suddenly moving at supersonic speeds to get to the new location after calculating the distance over time from any previous points, then the point is likely bogus. etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top