1

I am calculating the distance between two points given by latlng. However, Google Maps (i.e., web mercator projection) gives me a longer distance than Haversine formula.

Which is the most accurate measure? I can read in some answer that Haversine formula gives it.

So... Is Google Map lying when telling me distance in meters. e.g., in this webpage? http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/

Edit:

Example: In a small area around (37,0), if I calculate area (width,height), haversine results in (7750m*7753m) while Google results in (9784m*9784m).

15
  • 1
    How large are the differences you experience? Since the Haversine uses a spherical earth model, it will err slightly, depending on the configuration of the endpoints: see gis.stackexchange.com/questions/25494 for an analysis. Please give us a link to any answer that claims the Haversine formula is the "most accurate measure" so that we can help correct it.
    – whuber
    May 19, 2015 at 12:04
  • I edited the question to give an example. Sorry, I can not provide real coordinates. Hope it helps.
    – pedromateo
    May 20, 2015 at 9:14
  • Clearly those "Google results" are using the Mercator-projected coordinates, which will inflate distances at 37 degrees latitude by 25%. But Google Maps provides various ways of computing distances and some of them--such as its measurement tool--appear to be accurate. Exactly how are you using Google Maps to obtain these distances?
    – whuber
    May 20, 2015 at 13:22
  • Only slightly related, but why are you using Haversine and not Vincenty? May 20, 2015 at 14:16
  • @Mikkel Presumably because Google uses a spherical earth model for its "Web Mercator" projection. Even so, your question is pertinent because this thread is wondering about "most accurate measure" of distances, and surely a calculation using an ellipsoidal model will be more accurate than using a spherical model: see gis.stackexchange.com/questions/25494.
    – whuber
    May 20, 2015 at 14:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.