ccc-map/lookup.py

18 lines
455 B
Python
Executable File

#!/usr/bin/env python3
from geopy import Nominatim
geolocator = Nominatim(user_agent="my-mapper")
# first test to retreive geo coordinates
fn="ct-csv"
with open( fn, 'r' ) as fp:
for line in fp:
location = geolocator.geocode(line)
# ~ print (location.latitude, location.longitude)
if location is not None: # its a class
# ~ print (location)
print ( location.latitude, location.longitude)
fp.close()