18 lines
507 B
Python
18 lines
507 B
Python
from geopy.geocoders import Nominatim
|
|
geolocator = Nominatim(user_agent='This is a test')
|
|
|
|
ans = []
|
|
with open('data', 'r') as f:
|
|
for line in f.readlines():
|
|
address = line.split('\t')[3] + ' St Louis, MO'
|
|
# print(address)
|
|
location = geolocator.geocode(address)
|
|
print(location)
|
|
if location == None:
|
|
print('Error!')
|
|
else:
|
|
print('Ladue' in location.address or 'Creve Coeur' in location.address)
|
|
ans += location
|
|
|
|
print(ans)
|