From 2c974db4297334ff672e401c8bbfbaa5c50e2394 Mon Sep 17 00:00:00 2001 From: vv01f Date: Tue, 21 May 2019 23:10:20 +0200 Subject: [PATCH] get some geo coordinates --- lookup.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 lookup.py diff --git a/lookup.py b/lookup.py new file mode 100755 index 0000000..5dae718 --- /dev/null +++ b/lookup.py @@ -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()