domino
domino

Reputation: 7345

Getting distance between multiple cities

I'm looking for an easy way to find out the distances in miles (as the crow flies) between multiple cities.

Example (New York):

New York, NY - Tampa, FL New York, NY - Las Vegas, NV New York, NY - Moscow, Russia etc

I have over 20 cities that I need to determine the distance between... That's a lot of looking up to do manually (not just between the main city and other cities but between every city and every city)...

Any ideas?

Upvotes: 0

Views: 1891

Answers (2)

Mano Marks
Mano Marks

Reputation: 8819

Once you get the latitude/longitude from the Google Maps API geocoder, you can use the Geometry library to calculate the distances between them.

http://code.google.com/apis/maps/documentation/javascript/geocoding.html http://code.google.com/apis/maps/documentation/javascript/geometry.html#Distance

Upvotes: 1

DaedalusFall
DaedalusFall

Reputation: 8575

The Google Maps API might help you get the Latitude and Longitude of each, then you could use an algorithm (like http://www.movable-type.co.uk/scripts/latlong.html) to calculate the distances.

Upvotes: 0

Related Questions