Basically I’m making an app that is supposed to record a path and data that someone travels along. I’m having some trouble with accuracy and determining inaccurate reports. Here is an image of the path that my iPhone recorded. The red line is the recorded path, the pink is how I actually walked (apologies for the huge screenshot):

My delegate for recording the data looks like this:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
if (newLocation.horizontalAccuracy < 0) return;
NSTimeInterval locationAge = -[newLocation.timestamp timeIntervalSinceNow];
// The "> 50.0f" is to hopefully throw out inaccurate points
if (locationAge > 5.0 || [newLocation distanceFromLocation:oldLocation] > 50.0f) return;
[[self locationPoints] addObject:newLocation];
[self updateView];
}
Some advice that I’ve seen is to use filters to check if the data is appropriate for the projected path. Is this the best way to go?
You could add checking for
newLocation.horizontalAccuracy:Or, for your case:
This
(locationAge > 5.0)condition seems weird. Do you really want it? If you keep it in your app will stop updating if device looses proper GPS signal for>5.0s.One more thing: did you remeber to setup your
locationManagerwith:You should also know that this eats up quit a lot of battery, but for testing…