データを地図に見る
google colabにデータを地図上で表示するライブラリfoliumを使ってみる。
-
- サンプル1(東京駅の地図を見る)
parm1: location[緯度, 経度]
parm2: zom_start=18 (0から18まで拡大/縮小可能です)
import folium
map_ = folium.Map(location=[35.681384, 139.766073], zoom_start=18)
map_
import folium
#京急線の泉岳寺〜横浜までの緯度と経度を定義する
kk_ekis = [
['泉岳寺',35.638692,139.74002],
['品川',35.630152,139.74044],
['北品川',35.622716,139.739152],
['新馬場',35.61762,139.741366],
['青物横丁',35.609351,139.742905],
['鮫洲',35.605144,139.742547],
['立会川',35.598453,139.738803],
['大森海岸',35.587695,139.735465],
['平和島',35.579074,139.734996],
['大森町',35.572622,139.732169],
['梅屋敷',35.567042,139.728341],
['京急蒲田',35.560685,139.723731],
['雑色',35.549911,139.715199],
['六郷土手',35.540893,139.707789],
['京急川崎',35.532833,139.700896],
['八丁畷',35.523113,139.691488],
['鶴見市場',35.51783,139.686592],
['京急鶴見',35.50729,139.678098],
['花月園前',35.500413,139.67301],
['生麦',35.495297,139.666969],
['京急新子安',35.487106,139.65554],
['子安',35.484959,139.645635],
['神奈川新町',35.481462,139.640158],
['仲木戸',35.477312,139.634489],
['神奈川',35.471399,139.627467],
['横浜',35.466188,139.622715]]
#駅ごとのマックを地図につける
for kk_eki in kk_ekis:
folium.Marker([kk_eki[1], kk_eki[2]], popup=kk_eki[0]).add_to(map_)
map_