get some geo coordinates

This commit is contained in:
vv01f 2019-05-21 23:10:20 +02:00
parent 4656781ae4
commit 2c974db429
Signed by untrusted user who does not match committer: vv01f
GPG Key ID: 02625A16AC1D1FF6
1 changed files with 17 additions and 0 deletions

17
lookup.py Executable file
View File

@ -0,0 +1,17 @@
#!/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()