Voloda2
Voloda2

Reputation: 12607

Sometimes I receive the wrong GPS location

Sometimes I receive the wrong value for my current location, an error of up to 2 miles. Am I doing everything correctly?

self.myLocation = [[CLLocationManager alloc] init];
myLocation.delegate = self;
myLocation.desiredAccuracy = kCLLocationAccuracyBest;
[myLocation startUpdatingLocation];

What's the most accurate method to receive GPS location?

Upvotes: 0

Views: 568

Answers (1)

Roger
Roger

Reputation: 15813

You get a stream of location updates from the device when you start monitoring location change and so you need to consider both the timestamp of the location update and its horizontal accuracy.

Use the timestamp to reject old values (for example when you first start monitoring, you will be sent an accurate (at the time) but old cached value).

Use the horizontal accuracy to reject values that are outside of your desired range.

Upvotes: 3

Related Questions