Created
April 21, 2016 08:05
-
-
Save cindygis/0ff39c0875758a9db2af1229998978db to your computer and use it in GitHub Desktop.
Quickly reverse geocode coordinates in a spreadsheet
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 pandas as pd | |
xls = r'C:\Some\Arb\Folder\coords.xls' | |
out_xls = r'C:\Some\Arb\Folder\geocoded.xls' | |
df = pd.read_excel(xls) | |
for index, row in df.iterrows(): | |
g = geocoder.google([row[3], row[2]], method='reverse') | |
df.set_value(index, 'Street Address', g.address) | |
df.to_excel(out_xls, 'Geocoded') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment