Skip to content

Instantly share code, notes, and snippets.

@poguez
Created March 8, 2014 16:01
Show Gist options
  • Save poguez/9434005 to your computer and use it in GitHub Desktop.
Save poguez/9434005 to your computer and use it in GitHub Desktop.
Geocoding con Python
import urllib2
import pprint
import json
add = "Buckingham Palace, London, SW1A 1AA"
add = urllib2.quote(add)
geocode_url = "http://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false&region=uk" % add
print geocode_url
req = urllib2.urlopen(geocode_url)
jsonResponse = json.loads(req.read())
pprint.pprint(jsonResponse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment