続きです。
- 英語版の公開(たぶん別のページで)
に対応します。
あと、QRコードも追加します。単なる思い付きです。
まずはデータです。ファイル名は変わらずDaidougei_world_cup_2025_points.csv
です。name_en
・desc_en
列を追加しました。英文は生成AIにお願いし、気になる箇所だけ直しました。
id,name,name_en,desc,desc_en,timeslot,district,lat,lon
1,キリンポイント,Kirin Point,駿府城公園の紅葉山庭園前広場の北側。北側の橋から駿府城公園に入ってすぐ。,North side of the Momijiyama Garden Plaza in Sunpu Castle Park. Enter from the north bridge and it’s right there.,11:00-19:00,静岡市葵区,34.9800745886027,138.384199519385
2,トコチャン広場,Tocochan Plaza,駿府城公園の紅葉山庭園前広場の南側。北側の橋から駿府城公園に入ってすぐ。,South side of the Momijiyama Garden Plaza in Sunpu Castle Park. Right after crossing the north bridge.,11:00-19:00,静岡市葵区,34.9797661965445,138.383920420468
3,SBSどき!どき!ランド,SBS Doki! Doki! Land,駿府城公園の東御門前広場。南側の橋から駿府城公園に入って、公園内側の通路を反時計回りに。もしくは東側の門から駿府城公園に入って通路を道なりに,"Plaza in front of the East Gate of Sunpu Castle Park. From the south bridge, walk counterclockwise along the inner path, or enter from the east gate and follow the path straight.",11:00-19:00,静岡市葵区,34.9787456196104,138.384186760562
4,アイワポイント,Aiwa Point,南側の橋から駿府城公園に入って、公園内側の通路を時計回りに。有料のプレミアムシートあり。詳細はhttps://daidogei-gb.com/premium-seat/ ,Enter from the south bridge and walk clockwise along the inner path. Paid premium seats available. Details: https://daidogei-gb.com/premium-seat/ ,11:00-19:00,静岡市葵区,34.979079461549,138.382064572026
5,シズガスポイント,Shizu-gas Point,南側の橋から駿府城公園に入ってすぐ。11月1日・2日は11:00-17:30、地元静岡で活動するアーティストやアマチュアがステージに,"Just after entering from the south bridge. Open on Nov 1st and 2nd 11:00–17:30, local and amateur performers from Shizuoka take the stage.",11:00-19:00,静岡市葵区,34.9778955289323,138.382263928407
6,キッズガーデンポイント,Kids Garden Point,駿府城公園の富士見芝生広場(公園西側)。10月31日は無し,Fujimi Play Area on the west side of Sunpu Castle Park. Closed on Oct 31.,11:00-15:30,静岡市葵区,34.9782993224402,138.381235249466
7,ウォーキングストリート1,Walking Street 1,南側の橋から駿府城公園に入ってすぐ。アーティストの出演時間帯・場所は非公開。,Just after entering from the south bridge. Artist performance times and exact spots are not public.,11:00-19:00,静岡市葵区,34.9781695715767,138.382331681033
8,AFC-HD企業集団プレゼンツプレミアムステージ,AFC-HD Group Presents Premium Stage,静岡市中央体育館。有料。11:00-13:30・17:-00-20:00の2部制。詳細はhttps://daidogei-gb.com/premium-stage/ ,Shizuoka City Central Gymnasium. Paid event. Two sessions: 11:00–13:30 and 17:00–20:00. Details: https://daidogei-gb.com/premium-stage/ ,11:00-20:00,静岡市葵区,34.9816511838764,138.385015861213
9,富士テクノロジーポイント,Fuji Technology Point,静岡市中央体育館の前の広場,Plaza in front of Shizuoka City Central Gymnasium.,11:00-19:00,静岡市葵区,34.9815830573316,138.385876850304
10,体感型動物園iZooポイント,iZoo Point,静岡市市役所北側入口にある大階段の前。10月31日は無し,In front of the large stairs at the north entrance of Shizuoka City Hall. Closed on Oct 31.,11:00-18:00,静岡市葵区,34.9757404302136,138.38276357842
11,福工房札の辻ポイント,Fukukobo Fudanotsuji Point,呉服町通りと七間町通りの交差点、伊勢丹静岡店前。10月31日は無し,"At the intersection of Gofukucho and Shichikencho streets, in front of Isetan Shizuoka. Closed on Oct 31.",11:00-18:00,静岡市葵区,34.974908997117,138.38178129056
12,ARTIEポイント,ARTIE Point,七間町通りに面するARTIE(アルティエ)の野外ステージ。詳細はhttps://www.artie-info.com/ ,Outdoor stage in front of ARTIE on Shichikencho Street. Details: https://www.artie-info.com/ ,11:00-18:00,静岡市葵区,34.9742343150152,138.381529743162
13,ウォーキングストリート2,Walking Street 2,青葉シンボルロードの駐輪場のある区画。アーティストの出演時間帯・場所は非公開。,Section of Aoba Symbol Road with bicycle parking. Artist schedule and locations are not public. ,11:00-18:00,静岡市葵区,34.9737392751387,138.382319878027
14,ウォーキングストリート3,Walking Street 3,呉服町通りから七間町通り(静岡パルコ前から伊勢丹静岡店前、ARTIE前まで)。アーティストの出演時間帯・場所は非公開。,From Gofukucho to Shichikencho Street (from Shizuoka PARCO to Isetan and ARTIE). Artist schedule not announced.,11:00-18:00,静岡市葵区,34.9738427788549,138.384345921916
15,青葉パークポイント,Aoba Park Point,青葉シンボルロードの両替町通り南側の区画,South section of Ryogaemachi Street along Aoba Symbol Road. ,11:00-18:00,静岡市葵区,34.9734980169363,138.382099289057
16,青葉キリンポイント,Aoba Kirin Point,青葉シンボルロードの江崎新聞社の近くの区画。11月1日は12:00-18:30,Near Ezaki Newspaper building on Aoba Symbol Road. Open on Nov 1 12:00–18:30.,11:00-18:00,静岡市葵区,34.973174325793,138.381943777323
17,ちゅうでん常磐公園ポイント,Chuden Tokiwakoen Point,青葉シンボルロードの終点である常磐公園。他のポイントから離れている。10月31日は無し,Tokiwakoen Park at the end of Aoba Symbol Road. A bit away from other points. Closed on Oct 31.,11:00-18:00,静岡市葵区,34.9704725323768,138.380228996879
18,しずマチゲートウェイポイント,Shizumachi Gateway Point,三菱UFJ銀行静岡支店の前。10月31日は無し,In front of MUFG Bank Shizuoka Branch. Closed on Oct 31.,11:00-18:00,静岡市葵区,34.9728756370867,138.387257991352
19,駿河屋ポイント,Surugaya Point,駿河屋ビル(駿河屋本店)の前。10月31日は無し,In front of the Surugaya main store building. Closed on Oct 31.,11:00-18:00,静岡市葵区,34.9739621182013,138.387548588402
20,駿河屋スゴワザポイント,Surugaya Sugowaza Point,駿河屋ビル(駿河屋本店)の4階,4th floor of the Surugaya main store building. ,11:00-18:00,静岡市葵区,34.9741488742277,138.388204965628
21,セノバポイント,Cenova Point,静岡駅と駿府城公園の中間地点となる新静岡セノバの3階にあるセノバキッチン(フードコート)。10月31日は14:00-18:30。フロアマップはhttps://www.cenova.jp/shop/floor.jsp?fid=3f ,Halfway between Shizuoka Station and Sunpu Castle Park. Open on Oct 31 14:00–18:30. Floor map: https://www.cenova.jp/shop/floor.jsp?fid=3f ,11:00-18:00,静岡市葵区,34.975646786955,138.386683719741
22,ドリームプラザ1,Dream Plaza 1,エスパルスドリームプラザの海側ウッドデッキ。清水駅・新清水駅からドリームプラザは無料シャトルバスがある。時刻表はhttps://www.dream-plaza.co.jp/shuttle-bus/timetable/ ,Ocean-side wooden deck at S-Pulse Dream Plaza. Free shuttle bus from Shimizu or Shin-Shimizu Stations. Timetable: https://www.dream-plaza.co.jp/shuttle-bus/timetable ,11:00-17:00,静岡市清水区,35.010253706182,138.493776551674
23,ドリームプラザ2,Dream Plaza 2,エスパルスドリームプラザの海側にあるテルファークレーン(モノレールのようなクレーン)の前。清水駅・新清水駅からドリームプラザは無料シャトルバスがある。時刻表はhttps://www.dream-plaza.co.jp/shuttle-bus/timetable/ ,In front of the Telpher Crane (monorail-like crane) on the ocean side of S-Pulse Dream Plaza. Free shuttle bus from Shimizu or Shin-Shimizu Stations. Timetable: https://www.dream-plaza.co.jp/shuttle-bus/timetable ,11:00-17:00,静岡市清水区,35.0109697530046,138.493323315734
コードです。日本語版・英語版で処理は同じなので、ループで処理するようにしました。
QRコードは、以下を使って作成してます。
from folium import FeatureGroup, LayerControl, Element
import folium
import pandas as pd
import geopandas as gpd
import re
# URLをハイパーリンクに置き換え
def linkify(text, label="こちら"):
"""テキスト中のURLをハイパーリンクに変換"""
return re.sub(
r"(https?://\S+)",
rf'<a href="\1" target="_blank" rel="noopener noreferrer">{label}</a>',
text
)
# 初期表示の座標
center_lat, center_lon = 34.9765, 138.3828
# CSVファイルを読み込み、GeoDataFrameに
df = pd.read_csv("Daidougei_world_cup_2025_points.csv")
gdf = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df["lon"], df["lat"]), crs="EPSG:4326")
# 言語の種類でループ
for lang in ["jp", "en"]:
# インタラクティブ地図(ベースマップはOpenStreetMap)を生成
interactive_map = folium.Map(
location=[center_lat, center_lon],
zoom_start=16,
tiles="OpenStreetMap",
attr="OpenStreetMap",
)
link_label: str = ""
name_col = ""
desc_col = ""
note_body = ""
output_file = ""
if lang == "jp": # 日本語版
link_label = "こちら"
#参照する列名
name_col= "name"
desc_col = "desc"
# 注釈本文
note_body = """
<b>この地図は個人がまとめたものであり、公式ではありません。</b><br>
情報は大道芸ワールドカップin静岡2025公式ガイドブックから抜粋したものです。<br>
最新の情報は
<a href="https://daidogei.com/guidebook/" target="_blank" rel="noopener noreferrer">
オフィシャルサイト</a>をご確認ください。
<br/>
QRコードは株式会社デンソーウェーブの登録商標です。
"""
else: # 英語版
link_label = "link"
#参照する列名
name_col= "name_en"
desc_col = "desc_en"
# 注釈本文
note_body = """
<b>This map is an unofficial summary created by an individual.</b><br>
Information is excerpted from the official Daidogei World Cup in Shizuoka 2025 guidebook.<br>
For the latest updates, please visit the
<a href="https://daidogei.com/guidebook/" target="_blank" rel="noopener noreferrer">
official site</a>.
<br/>
QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and in other countries.
"""
# 加工用のGeoDataFrameは言語ごとに分ける
gdf_lang = gdf.copy()
# ポップアップのHTMLタグの列を追加
gdf_lang["popupContent"] = gdf_lang.apply(
lambda r: f"<b>{r['id']} {r[name_col]}</b><br/>{r['timeslot']}<br/><br/>{linkify(text=r[desc_col], label=link_label)}",
axis=1
)
# 時間帯ごとにグループ化し、ループ
for timeslot, subset in gdf_lang.groupby("timeslot"):
# グループを作成
fg = FeatureGroup(name=f"{timeslot}")
# グループに所属するポイントのマーカーを、グループに追加
for _, row in subset.iterrows():
folium.Marker(
location=[row["lat"], row["lon"]],
popup=folium.Popup(row["popupContent"], max_width=300),
tooltip=row[name_col],
icon=folium.Icon(color="blue", icon="info-sign"),
).add_to(fg)
# グループをインタラクティブ地図に追加
fg.add_to(interactive_map)
# 画面の右上に置くレイヤーコントロールを生成し、インタラクティブ地図に追加
LayerControl(collapsed=False, position="topright").add_to(interactive_map)
# 注釈用HTMLタグをインタラクティブ地図に追加
note_html = f"""
<div style="
position: fixed;
bottom: 5px;
left: 5px;
width: min(70vw, 250px);
padding: 5px;
background-color: rgba(255, 255, 255, 0.8);
border: 1px solid #ccc;
font-size: 12px;
z-index: 9999;
">
{note_body}
</div>
"""
interactive_map.get_root().html.add_child(Element(note_html))
map_url = "" # URLを設定
# QRコード用HTMLタグを追加
qr_html = f"""
<div style="
position: fixed;
bottom: 20px;
right: 5px;
width: 120px;
height: 120px;
background-color: rgba(255, 255, 255, 0.8);
border: 1px solid #ccc;
border-radius: 8px;
padding: 10px;
text-align: center;
z-index: 9999;
">
<img src="https://api.qrserver.com/v1/create-qr-code/?size=120x120&data={map_url}"
alt="QR code" width="100" height="100"><br>
</div>
"""
interactive_map.get_root().html.add_child(Element(qr_html))
# ファイル出力
output_file = f"daidougei_world_cup_in_shizuoka_2025_points_{lang}.html"
interactive_map.save(output_file)
print(f" {output_file} を出力しました。")
print(f" map_url: {map_url} ")
それっぽくなった気がします。
英語版はこちらで公開しています。
日本語版はこちらです。
なお、最近、公式サイトにオンラインマップがあることに気づきました。
こちらは、グーグルマップのマイマップの機能で作成してるようですね。