Created
November 15, 2014 20:54
-
-
Save adoc/f9fced7a68fa1b886e69 to your computer and use it in GitHub Desktop.
mapquest_geocode.py: Geocoding example using mapquest API. (geopy)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from geopy.geocoders import MapQuest, OpenMapQuest, Nominatim | |
omapquest_api_key = "APIKEYHERE" | |
gm = MapQuest(api_key=omapquest_api_key, timeout=60) | |
gom = OpenMapQuest(api_key=omapquest_api_key, timeout=60) | |
gn = Nominatim(timeout=60) | |
loc = "611 West Holt Blvd., ontario, ca, 91762" | |
l = gom.geocode(loc) or gm.geocode(loc) | |
print(l.latitude) | |
print(l.longitude) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment