Created
February 18, 2015 23:13
-
-
Save misterhay/1d2dcd0ae30cd915990b to your computer and use it in GitHub Desktop.
translating addresses to latitude and longitude
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
import geocoder | |
import csv | |
def getGeo(address): | |
lat = geocoder.google(address).lat | |
lng = geocoder.google(address).lng | |
print lat, lng | |
source = csv.reader(open('source.csv', 'rb')) | |
for row in source: | |
street = row[3] | |
town = row[4] | |
address = street + ', ' + town + ', Alberta, Canada' | |
getGeo(address) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment