Search code examples
iphonecllocationmanagercllocationcllocationdistance

Getting different result from google distance API and native Distance finding function +iphone


I am working on iphone application where i need to find the points between 2 latitude and longitude

I had used:-

CLLocation* newlocation = [[CLLocation alloc] initWithLatitude:19.0759837 longitude:72.8776559];
 CLLocation* oldLocation = [[CLLocation alloc] initWithLatitude:19.075655999999999 longitude:72.87979];
            float kilo1=[newlocation getDistanceFrom:oldLocation]/1000;    

            CLLocationDistance distance = [newlocation distanceFromLocation:oldLocation];

And Checked the googleulr:- url

The distance from getDistanceFrom and distanceFromLocation function are:0.227512KM But in webservice it is showing the distance:0.300000

As there is alot of diference between this two result can any one suggest me which one is to be followed? According to me the result of webservice is right. But i cant use the webservice for finding the distance of 100points.As it is not feasible, Can anyone help me how do i get correct value

Thanks in advance


Solution

  • You are getting air distance using iPhone GPS(getDistanceFrom) and Driving distance using web service(URL provided by you).So Both are accurate but distance type are different.