

As far as I know, there's no way to apply either method to an actual physical route to adjust for curvature.

Both methods can be used in Stata using geodist from ssc (which has a great help file with references). The other method is to use the Vincenty equations (which is an slower, iterative process, but still assumes away terrain). This gives an ‘as-the-lazy-crow-flies’ distance between the points (ignoring the distance needed to go over any mountains or canyons on the way and assuming the earth is a sphere). The Haversine formula calculates the approximate great-circle distance between two points, which is the shortest distance over the earth’s surface. You can also calculate the length of the shortest curve between two points along the surface of a mathematical model of the earth. So given some maps, historical and real time data from various sources such cell phones, their algorithm picks the best route using a black box method. In another blog post, they link to the Wiki entry for Dijkstra's Algorithm when explaining how they pick the best route. These factors down to a "cost" associated with each candidate routeĪnd display the route with the lowest "cost."īiking directions seem to adjust for elevation in picking the route (though that does not mean the distance is adjusted for it). The meaning of best is pretty fuzzy:ĭeciding which route is "best" involves balancing competing factors:ĭistance, travel time, number of turns, and many more. Traveltime3 (and all its ancestors that work with previous versions of the Google API) uses Google's guess for the best driving/walking/biking distance along some viable route at a point in time.
