I've been having the hardest time trying to figure out why distanceFromLocation isn't calculting the correct distance for two CLLocations. The calculated result is a number WAY larger than the actual distance but the two locations appear to be valid locations.
First of all, here are the two locations:
LOCATION 1: <+44.56697840, -69.55759810> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2010-12-13 21:12:03 -0500
LOCATION 2: <+44.31400400, -69.79157000> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2010-12-13 21:12:03 -0500
And here is the code where Location1 and Location2 are being declared. I've verified that these are the correct values, but I still can't figure this out
CLLocation *newLocation = [[CLLocation alloc]
initWithLatitude:[latitude doubleValue]
longitude:[longitude doubleValue]];
// CURRENT LOCATION (OR SEARCHED LOCATION)
double dLat = 0;
int tmpDistance = 0;
id returnId = nil;
id tmp = [featuredResults objectAtIndex:i];
CLLocation *newLocation2 = [[CLLocation alloc]
initWithLatitude:[[tmp valueForKey:@"lat"] doubleValue]
longitude:[[tmp valueForKey:@"lng"] doubleValue]];
dLat = [newLocation distanceFromLocation:newLocation2];
The value that I'm getting for dLat is 330707027, which is way wrong. Does anyone know where I might be going wrong? Thanks!