Skip to content

Instantly share code, notes, and snippets.

@tluyben
Created January 27, 2015 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tluyben/d03bd370264f03294772 to your computer and use it in GitHub Desktop.
Save tluyben/d03bd370264f03294772 to your computer and use it in GitHub Desktop.
import json
import urllib2
city="bristol"
country="united kingdom"
citry = city.replace(' ', '+')
country = country.replace(' ', '+')
response = urllib2.urlopen("http://nominatim.openstreetmap.org/search?q="+city+"+"+country+"&format=json")
data = json.load(response)
data = data[0]
print(data['lon']+","+data['lat'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment