Google does some pretty impressive things – not just all the web-based search stuff, but they also have lot’s and lot’s of really cool API’s for programmers to peruse.
In order to access these API’s, you need a personal authorization key, which you can create at Google Developer Console, which in most cases will not be for free. (google it! 🙂
Anyhow, below a short Python example on how to map addresses – some of them being very vague! – to GPS coordinates. Considering that Google’s Geolocation services covers the entire world, it’s even more impressive that it can figure out the exact position of an address as vaque as for instance “Globen” below…!
import requests key='your-google-api-key' def map_addr_to_gps(address): payload = {'address':address,'key':key} url = 'https://maps.googleapis.com/maps/api/geocode/json' r = requests.get(url,payload) result = r.json() result = result['results'] for res in result: lat = res['geometry']['location']['lat'] lon = res['geometry']['location']['lng'] return (lat,lon) addr1 = 'arlanda t5' addr2 = 'stadshuset stockholm' addr3 = 'Globen' addresses = [addr1,addr2,addr3] for a in addresses: gps = map_addr_to_gps(a) print (gps[0],gps[1])