R Code for Regional Analysis: Interactive Scenario Modeling of Public Transport Infrastructure using Leaflet and GTFS Data 地域分析のためのRコード: LeafletとGTFSデータを用いた公共交通インフラのインタラクティブなシナリオ・モデリング

Read full text
Authors: Yasutoshi Moteki
Cited by: 3

Abstract

地域分析のためのRコード: LeafletとGTFSデータを用いた公共交通インフラのインタラクティブなシナリオ・モデリング 1. 本プログラムの目的と着想の原点 (Overview of V3) 本プログラムは、愛知県知多郡東浦町のコミュニティバス「う・ら・ら」の静的GTFSデータを活用し、R言語およびLeafletを用いて、政策科学に基づく政策立案を支援するインタラクティブなシナリオ検討ツールのプロトタイプ(V3)である。 本V3の開発にあたっては、2026年3月に卒業した第一期生の一人が、小牧市の交通政策を検討する過程で、QGISを用いて架空の鉄道路線をシミュレーションとして描画し、卒業論文に盛り込んだという独創的な発想に大きなヒントを得ている。 専門的なGISソフト上で行われたこの「将来像を描画する」という試行錯誤を、Webb et al. (2025) のアクセシビリティ評価理論、および住民が都市空間に対して抱く主観的な好悪や価値を可視化する Nasar (1990) の「評価的イメージ(Evaluative Image)」の理論的枠組みと統合した。 Nasar, J. L. (1990). The evaluative image of the city. Journal of the American Planning Association, 56(1), 41-53. https://doi.org/10.1080/01944369008975742 Webb, L., Langford, M., Higgs, G., & Berry, R. (2025). The design of a dynamic web-based solution to measure accessibility via public transport under different travel scenarios. Case Studies on Transport Policy, 21, 101561. https://doi.org/10.1016/j.cstp.2025.101561 Webブラウザ上での「お絵かき」を通じて、誰もが直感的に将来の交通網を構想できる「対話型モデリング装置」へと発展させたものが本コードである。なお、本コードの実装にあたっては、Google Gemini による技術的なコード生成支援を活用した。先行するV2が既存のGTFSデータを正確に可視化し「現状」を把握することに主眼を置いていたのに対し、このV3では「未来の可能性」をシミュレーションする機能を付加している。具体的には、地図上に自由にラインを描画することで、架空の新路線やルート変更がアクセシビリティに与える影響を即座に確認できる仕組みを導入した。これにより、専門家による固定的な計画提示ではなく、住民や実務者の自由な発想を「主観的なアクセシビリティ」として即座に空間データ化することが可能となっている。このボトムアップ型のシナリオ・モデリングは、単なる現状分析を超え、地域公共交通の再編に向けた創造的な合意形成を強力に支援する。専門的なGISスキルを介在させず、ブラウザ上での試行錯誤をそのまま政策対話の材料へと昇華させる点に、V3独自の学術的・実践的価値がある。 【補足:基本編のリファレンス】 GTFSデータの基本的な可視化(停留所やルートの単純な描画)については、本プロトタイプの基礎となる「V2」にて実装例を公開している。目的に応じて、以下のリポジトリも併せて参照されたい。 GTFSのシンプルな可視化(V2): https://doi.org/10.5281/zenodo.20116368 更新版のお知らせ:V3.5(動的・時間帯シミュレーション版) 標準的な静的データ(GTFS-JP)を利用して画面上に「仮想リアルタイム(RT)」環境を逆生成する、高度な動的運行モデリングや時間帯シミュレーションを必要とする利用者のために、最新の発展形であるバージョン3.5(V3.5)を以下のリンクから公開しています。 動的・時間帯シミュレーション版(V3.5): Moteki, Y. (2026). R Code for Regional Analysis: An Integrated Toolkit for Interactive Route Mapping and Dynamic Spatiotemporal Simulation Using GTFS Static Data (v3.5). Zenodo. https://doi.org/10.5281/zenodo.20303232 2. 国際的文脈:動的アクセシビリティ評価の設計思想 本ツールの設計思想は、英国ウェールズの研究グループが提案した最新のアクセシビリティ評価の枠組み(Webb et al., 2025)を、日本の地域文脈に最適化したものである。 Webb et al. (2025) は、特定のバス路線の新設や廃止といった異なる移動シナリオが、公共交通のアクセシビリティに与える影響を動的に分析・比較できるWeb-GISツールを提案している。本ツールは、この「動的なシナリオ検討」という価値を、極めて簡便な環境で具現化している。 3. 本コードの独自性:「素直な実装」による機動力 Webbらのシステムが重厚なサーバーサイド・インフラを要求するのに対し、本コードは以下の決定的な違いを有する。 インフラフリーの追求: Rの標準的な環境のみで動作し、サーバー構築を必要としない。これにより、ネットワーク制限のある行政現場や、制約の多いワークショップ会場でも即座にシナリオ検討を開始できる高い機動性を確保している。 試行錯誤を許容する劇場性: V3で実装した「一個取り消し(Undo/Delete)」機能により、参加者は失敗を恐れずに自分のアイデアを投影できる。これは、住民による「評価的イメージ」Evaluative Imagesの合成を促すための重要な心理的装置である。 ポータブルな成果共有: 住民が描いたオレンジ色の路線案は、ブラウザの出力機能を通じてそのまま画像・PDFとして保存(Export)し、地域公共交通会議等の公式なエビデンスとして活用できる。 4. バージョン3.0の主要機能 ワークショップ用描画ツール: 既存路線と対照的な「オレンジ色」をデフォルトとした路線引き・バス停設置機能。 一個取り消し(Undo/Delete)機能: 描画したオブジェクトを個別に修正・削除可能。 動的レイヤー制御: 「全日(ベース)」と「全便(最大)」の既存網を切り替えながら、新設案との重なりを検討可能。 流線図・オフセット表示: 便数に応じた線幅の変化や上下線の分離描画(V2の機能を継承)。 操作法 RStudioで本スクリプトを実行すると、既存のGTFSデータに基づいた路線網とバス停がインタラクティブマップ上に即座に描画される。マップ左側のツールバーにある「折れ線(Polyline)」アイコンを選択して地図上をクリックすることで、既存網と判別しやすいオレンジ色の新規路線案を自由に描画でき、その下の「ピン(Marker)」アイコンによって新規バス停を任意の位置に設置することが可能である。操作の誤りやルートの微調整が生じた際には、「鉛筆(Edit)」および「ゴミ箱(Delete)」アイコンを用いることで、個別のオブジェクト修正や「一個取り消し(部分削除)」を直感的に行うことができる。描画後は「星(Style Editor)」アイコンから対象を選択し、用途に応じて線の色や太さを変更することも可能である。さらに、右上のレイヤーコントロールにより、既存の運行データ(全日・全便)と新規提案案を重ね合わせて比較検討し、最終的な検討成果はブラウザの印刷機能(Ctrl + P)を用いてPDFや画像として保存することで、EBPM(証拠に基づく政策立案)に資する視覚的エビデンスとして記録できる。 [English] R Code for Regional Analysis: Interactive Scenario Modeling of Public Transport Infrastructure using Leaflet and GTFS Data 1. Purpose and Origin of the Prototype (Overview of V3) Purpose and Origin of the Prototype (Overview of V3) This program is a V3 prototype of an interactive scenario-modeling tool designed to support evidence-based policymaking (EBPM) for the "u-ra-ra" community bus system in Higashiura-cho, Chita-gun, Aichi Prefecture. It utilizes R, Leaflet, and General Transit Feed Specification (GTFS) data.The development of V3 was inspired by the creative insight of a member of the first graduating class (March 2026), who utilized the Quantum Geographic Information System (QGIS) to simulate and draw "imaginary transit routes" for their graduation thesis on transport policy in Komaki City. This code transforms the trial-and-error process of "mapping a future vision"—originally performed using professional GIS software—into an interactive modeling device. It integrates Webb et al.’s (2025) accessibility evaluation theories with Nasar’s (1990) Evaluative Image theoretical framework , which visualizes residents’ subjective preferences and values toward urban spaces. [Note: Reference for Basic Visualization] For basic visualization of GTFS data (simple rendering of stops and routes), a completed implementation is available in V2, which serves as the foundation for this prototype. Please refer to the following repository depending on your specific research needs: Basic Visualization of GTFS (V2): https://doi.org/10.5281/zenodo.20116368 Notice of Latest Version: V3.6 Multi-Agency Spatiotemporal Integration Simulation Version The latest version, V3.6: Multi-Agency Spatiotemporal Integration Simulation Version, has been released. It integrates past functions of static analysis, scenario modeling, and single-municipality spatiotemporal simulation into a comprehensive framework, extending capabilities to analyze regional transit networks. The key feature of this system is its approach to generating dynamic time-series simulations using only static GTFS data (schedules and geographic information), such as the standard GTFS-JP format in Japan, without relying on expensive real-time data (GTFS-RT) delivery infrastructure. While the previous V3.5 focused on a single community bus service with 10-minute step intervals, the latest V3.6 shortens the step interval to 5 minutes to improve the visual smoothness of vehicle dynamics. Furthermore, it introduces Integrated Transit Network Mapping, combining private transit lines and community bus services into a single simulation environment. https://doi.org/10.5281/zenodo.20325726 Notice of Updated Version: V3.5 (Dynamic and Time-Slot Simulation Edition) For users who require advanced dynamic operational modeling and time-slot simulations—utilizing standard static data (GTFS-JP) to reverse-generate a "virtual real-time (RT)" environment—the latest evolved version (V3.5) is available via the link below: Dynamic and Time-Slot Simulation Edition (V3.5): Moteki, Y. (2026). R Code for Regional Analysis: An Integrated Toolkit for Interactive Route Mapping and Dynamic Spatiotemporal Simulation Using GTFS Static Data (v3.5). Zenodo. https://doi.org/10.5281/zenodo.20303232 Through browser-based "drawing," this tool allows anyone to intuitively conceptualize future transport networks. Technical assistance from Google Gemini was utilized to implement this code. 2. International Context: Design Philosophy for Dynamic Accessibility This tool’s design is globally positioned within the dynamic accessibility evaluation framework proposed by a research group in Wales (Webb et al., 2025). Webb et al. proposed a system where policymakers can dynamically analyze how different scenarios—such as new routes or service withdrawals—affect public transport accessibility. This R script implements the "Scenario Three" (Modeling new routes) logic within a significantly more agile environment. 3. Uniqueness of the Code: The "Infrastructure-Free" Approach While the system described by Webb et al. has heavy server-side infrastructure requirements (PostgreSQL/PostGIS, OpenTripPlanner, GeoServer, and PHP), this code offers the following: Infrastructure-Free Deployment: Operates entirely within a standard R environment. It requires no server setup, making it highly mobile for use in administrative offices or workshop venues with limited network infrastructure. Learning through Trial and Error: The "Undo/Delete" and "Edit" features allow users to draft and refine routes without fear of making mistakes. This facilitates the synthesis of "Evaluative Images" as defined by Nasar (1990) and Barros et al. (2022) . Portable Evidence: Proposed routes drawn in "Dark Orange" can be exported directly as high-resolution images or PDFs via browser functions, serving as immediate visual evidence for public transport council meetings. 4. Key Features of Version 3.0 Workshop Drawing Toolbar: Dedicated tools for drawing routes and placing bus stops using a high-contrast "Dark Orange" theme to distinguish proposed networks from existing ones. Undo/Delete Functionality: Allows users to remove or modify drawn objects to support iterative brainstorming. Dynamic Layer Control: Enables users to toggle between "Standard" and "Maximum" existing service levels while overlaying new route proposals. Flow Mapping & Offsets: Inherits V2 features, including dynamic line thickness based on trip frequency and spatial offsets for bi-directional route visualization. 5. Academic and Practical Value This script serves as a "minimum viable tool" for bridging the gap between raw GTFS data and collaborative regional planning. Created by integrating pedagogical insights from a student's thesis with international transport policy theories, this tool provides a versatile platform for researchers, students, and local government officials to visualize and "draw" the future of regional mobility. References: Barros, M. S., Degbelo, A., & Filomena, G. (2022). Evaluative image 2.0: A web mapping approach to capture people’s perceptions of a city. Transactions in GIS, 26, 1116–1139. https://doi.org/10.1111/tgis.12867 Nasar, J. L. (1990). The evaluative image of the city. Journal of the American Planning Association, 56(1), 41-53. https://doi.org/10.1080/01944369008975742 Webb, L., Langford, M., Higgs, G., & Berry, R. (2025). The design of a dynamic web-based solution to measure accessibility via public t

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
12 May 2026
Language
EN