开发者

cllocation tracking a location

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:

cllocation tracking a location

(source: alluneed.it)

开发者_JAVA百科

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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜