Here is a list of all the 8102 municipalities (city, town and villages) of Italy: [login to view URL]
I need these three things:
1) I need a script or program, in whatever language you want, that gets their latitude/longitude from Google Maps
Note1: Google queries must be done in http://maps.google.it. You can grab latitude and longitude from the URL of the link named 'Collegamento a questa pagina' on the bottom-right of the page.
Note2: be aware that Google has a block after (I think but I'm not sure of the number) 5000 subsequent queries from the same IP. You will need to wait a day (?) or to use a proxy for the remaining queries.
2) then I need you to upload the 8102 municipalities names and their latitude/longitude in my MySQL database
Note: I can import your Utf-8 SQL file to do this.
3) then I need you to put on my webserver a PHP or Perl or ASP program that, given a municipality and a radius in KM as parameters (e.g. '[login to view URL];amp;radius=15'), returns a list with all the municipalities that are within this radius including the given municipality.
Note1: to obtain the distances between the returned municipalities given the latitude/longitude you must use an algorithm like [login to view URL] or another that takes into account the actual polar flattening of the earth and the equatorial bulge...
Note2: the execution time, given a radius of 100 KM, must not exceed 0.2 seconds, therefore you will need to calculate the distances in two steps: the first step will use a very simple and fast but unprecise algorithm to exclude the most of the municipalities, that that are clearly more far that the given radius; the second step will use the slower but more precise algorithm described in Note1 to accurately decide if the remaining municipalities are within the given radius.
_____
Full source code and ownership required. Escrow offered.