Jump to content

distance between 2 points


skaterdav85

Recommended Posts

I am creating a store locator page on a mobile device using the phone's current location and the lat/long of the store. What is the most efficient method on a mobile device to find the distances between the 2 points? Should I use something like the Vincenty Formula: http://www.movable-type.co.uk/scripts/latlong-vincenty.htmlor the Google Maps API?

Link to comment
Share on other sites

It seems the formula is for straight lines... and directions don't usually involve straights.You should better use Google's API for directions, ideally letting people choose between car and walking directions.

Link to comment
Share on other sites

Yup. In a hypothetical city laid out with perfectly rectangular grids, a straight line will always be approx 1.4 times too short.In a mountainous region (like the one where I live) a straight line is generally way too short. I routinely drive 4-5 times the straight-line distance to reach nearby cities.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...