https://mino-park7.github.io/effective python study/2018/10/31/betterway45-minhopark/
ISO 3166에 따른 국가명 부여하기(A2는 2글자, A3는 3글자)
이 국가명 코드가 있으면 superset 에서 world map을 만들 수 있음
UTC → Localtime
def my_localtime(lat, lng, utc) :
import timezonefinder, pytz
from datetime import datetime
utc = utc.split('.')[0]
utc = datetime.strptime(utc, '%Y %m %d %H:%M:%S')
tf = timezonefinder.TimezoneFinder()
timezone_str = tf.certain_timezone_at(lat=lat, lng=lng)
timezone = pytz.timezone(timezone_str)
delt = timezone.utcoffset(utc)
localtime = utc + delt
return localtime, timezone_str
import reverse_geocoder as rg
lat = 35.5444
lon = 129.3766
# center = [44.94136227368586, 34.04122216590966]
center = [33.417, 126.539]
location_info = rg.search(center, mode=1)[0]
print('igor', location_info)
from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="geoapiExercises")
location = geolocator.reverse(f'{lat},{lng}', language='en')
country = location.raw['address']['country']
country_code = location.raw['address']['country_code']