Files
meshing-around/locationdata.py
2024-06-19 15:35:16 -07:00

13 lines
346 B
Python

# helper functions to use location data
# K7MHI Kelly Keeton 2024
from geopy.geocoders import Nominatim # pip install geopy
def where_am_i(lat=0, lon=0):
# initialize Nominatim API
geolocator = Nominatim(user_agent="mesh-bot")
location = geolocator.reverse(lat+","+lon)
address = location.raw['address']
return address