I need a script or program, in whatever language you want, that:
1) grabs the full list of municipalities (city, town, villages) names of USA (for single states), Canada, UK, Germany, France, Italy, Spain, Australia, from Wikipedia
2) gets their latitude/longitude from Google Maps
3) create a table, one for each state, of the straight-line distances from each of them to each of them, using this ready algorithm [url removed, login to view] (or another that takes into account the actual polar flattening of the earth and the equatorial bulge...)
About the Google Maps part:
- when ambiguity is found for a city name (try for example "Agrate, Italy") it must choose the first Google suggestion and log the original name + that of the choosed suggested one in a text file named "[url removed, login to view]".
- queries for USA municipalities must indicate the state too (e.g. "Sayreville, NJ, USA") for increased precision. The others must be in the form "Rome, Italy".
Full source code and ownership required. Escrow offered.