ex = openpyxl.load_workbook('./2020년04월30일기준_무인민원발급창구_설치장소_및_운영시간(민원24).xlsx')
muin = ex['4월30일']
num = 2
address = []
name = []
while True:
if '서울' in muin.cell(row=num, column=6).value:
# 주소 저장
address_b = muin.cell(row=num, column=6).value
address_a = address_b.split('(')[0]
address.append(address_a)
# 이름 저장
name_b = muin.cell(row=num, column=3).value
name.append(name_b)
num+=1
continue
else:
break
# print(len(address))
# print(len(name))
xpoint = []
ypoint = []
for i in address:
x, y= getLatLng(i)
xpoint.append(x) # 경도 저장
ypoint.append(y) # 위도 저장
지도 및 마커 추가
map_list = folium.Map(location=[37.566659527,126.978346859], zoom_start=10)
for item in range(len(address)):
latitude = float(ypoint[item])
longtitude = float(xpoint[item])
# 예외처리 : 서울특별시 용산구 이태원로 22(용산동3가)의 정보 못불러옴
if latitude == 0:
continue
folium.Marker(
location = [latitude, longtitude],
popup = name[item],
icon=folium.Icon(color='red', icon='glyphicon glyphicon-print')
# icon 적용 할 때 부트스트랩 최신버전을 사용하면 표시안됨. 3버전 이용
).add_to(map_list)
map_list
Make this Notebook Trusted to load map: File -> Trust Notebook