I am working on a tracking app, which needs to display the tracking path on map. When I start updating location and does not move the device after the installation, the locationManagar reports wrong location updates,

I am drawing a route based on location points reported,
Also when user is driving in a vehicle at high speed on straight road, it shows glitches like this as well,
How can I ignore these erroneous location updates.
You can download the app here and test yourself
Have a look at Horizontal Accuracy check this to make sure you have an accurate location. For example below 10meters or below zero:
// test that the horizontal accuracy does not indicate an invalid measurement
if (lastLocation.horizontalAccuracy < 0)
return;
And make sure you have a new location because it will return the last one default:
// test the age of the location measurement to determine if the measurement is cached
// in most cases you will not want to rely on cached measurements
NSTimeInterval locationAge = -[lastLocation.timestamp timeIntervalSinceNow];
if (locationAge > 5.0)
return;
Also make sure you set the right desiredAccuracy on the CLLocationManager. For example:
_manager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With