mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-08-07 09:22:44 +02:00
Update locationdata.py
This commit is contained in:
+15
-2
@@ -9,6 +9,19 @@ def where_am_i(lat=0, lon=0):
|
||||
|
||||
location = geolocator.reverse(lat+","+lon)
|
||||
address = location.raw['address']
|
||||
whereIam = address['house_number'] + " " + address['road'] + ", " + address['city'] + ", " + address['state'] + " " + address['postcode']
|
||||
|
||||
if 'house_number' in address:
|
||||
whereIam += address['house_number'] + " "
|
||||
if 'road' in address:
|
||||
whereIam += address['road'] + ", "
|
||||
if 'city' in address:
|
||||
whereIam += address['city'] + ", "
|
||||
if 'state' in address:
|
||||
whereIam += address['state'] + " "
|
||||
if 'postcode' in address:
|
||||
whereIam += address['postcode']
|
||||
if 'county' in address:
|
||||
whereIam += " " + address['county']
|
||||
if 'country' in address:
|
||||
whereIam += " " + address['country']
|
||||
|
||||
return whereIam
|
||||
Reference in New Issue
Block a user