Published June 3, 2026 | Version v2.2
Software Open

R Code for Regional Analysis: GPS-Enabled and Mobile-Optimized Visualization of Haiku Monuments in Mie Prefecture with Leaflet and GSI Satellite Imagery 地域分析のためのRコード:GPS利用・スマホ対応による三重県の句碑の可視化(Leafletと地理院衛星画像を使用)

  • 1. ROR icon Nanzan University

Description

地域分析のためのRコード:GPS利用・スマホ対応による三重県の句碑の可視化(Leafletと地理院衛星画像を使用)

概要

本リポジトリは、三重県が公開する「三重県内の句碑」オープンデータを活用し、R言語(leafletおよびdplyr)を用いて空間的な可視化を行う地域分析用のプロトタイプスクリプト、および再現可能(Replication)なデータパッケージである。国土地理院の標準地図と高解像度な衛星画像(写真)の切り替え機能を実装し、各句碑の位置に詠まれた「句」や建立年月、詳細な由来を美しく構造化したポップアップで表示するインタラクティブなWeb地図を生成する。行政が提供するオープンデータでの句碑や歌碑の提供としては、鳥取県の尾崎放哉の句碑のオープンデータがある(緯度経度や「放哉百選でのページ数のデータがCSVに含まれている。」)。https://odp-pref-tottori.tori-info.co.jp/dataset/1641.html 散在しがちな地域の文化資源をデジタル・ヒューマニティーズの観点から統合・可視化するオープンサイエンスの実践例であり、将来的には地域の生活者の愛着や感想といった主観的ナラティブ(語り)を地理空間情報へ重ね合わせる、参加型GIS(PPGIS)やエモーショナル・マッピングの発展に向けた基盤的テンプレートとなることを目指している。

なお、近年ではCIDOC CRMやLOD、LLM/MCPサーバーを用いた全国規模の句碑データ利活用基盤の研究(例:CiNii CRID 1050587970429961728)などのシステム開発アプローチが見られるが、本リポジトリは公的オープンデータを直接活用し、Rコードによる実用的かつ再現可能な「地域分析」のオープンな実装例を提供する点に固有の特徴と独自性を持つ。作成にあたっては、生成AI(Google Gemini)によるコード作成支援を活用している。

Version v2.2:出典表記の明確化と現場仕様のクラスター解除

国土地理院の公式ガイドラインに準拠し、冗長な文言を削ぎ落とした「出典: 『地理院タイル』に『三重県内の句碑』を追記」というクレジットをUI右下に実装しました。同時に、実地で得られた知見に基づき、超近接領域を除いて広域表示の段階から各マーカーを独立して露出させるクラスター抑制機能(マッピング半径の極小化およびズーム時の強制展開ロジック)を導入し、現場における直感的な位置把握と地域探索の快適性を向上させています。

Version v2.1:現地検証の実施と動作写真の追加

実際のモバイルフィールド環境におけるGPSと地理院レイヤーの確実な協調動作を確認する実地検証を行い、有機的なタイムスタンプを含む初期画面のスクリーンショットを検証資材として新たに拡充しました。

V2.0更新のお知らせ

Version 2.0へのメジャーアップデートでは、従来の机上でのデータ分析用途から、スマートフォン等を用いた現地での巡検(フィールドワーク)における実用性を重視した仕様へと刷新した。主な機能拡張として、GPS連動による現在地の自動・手動取得機能を実装。モバイル端末の画面でも操作しやすいよう、マーカーの拡大や視認性を高めたクラスター表示など、ユニバーサルデザインへの配慮を行っている。また、通信環境の不安定な地域を想定し、起動時にはまず広域(zoom=11)を描画した上で、位置特定後に周辺環境を俯瞰しやすい縮尺(zoom=13)へと移行する二段階の設計を採用した。

Web上でのShinyアプリの公開

本研究で構築したデータセットおよび前処理パイプラインの有用性を実証するため、ブラウザ上で動作するウェブ上のデモを https://moteki.shinyapps.io/mie-haiku-monuments/ にて公開している 。なお、本アプリケーションは月間の合計稼働時間に一定の上限はあるものの、自前サーバーの運用と比較して高い安定稼働を確認している。万が一、上限超過やメンテナンス等により一時的にアクセスできない場合は、本リポジトリからデータおよびコードをローカル環境にダウンロードして実行されたい

GPS対応版のデモ https://moteki.shinyapps.io/mie_kuhi_gps/

使用データの説明および入手先

  • データ名称:三重県内の句碑

  • 提供主体:三重県(環境生活部 文化振興課)

  • データ概要:三重県内に集積・点在する松尾芭蕉、山口誓子をはじめとした著名な俳人の句碑(全302件)について、その名称、詠まれた句、所在地、建立年月、由来、および地図上にプロットするための地理座標(緯度・経度)を網羅的に収録した公的オープンデータ。

  • 主な収録項目(カラム構成):

    • 管理番号、句碑名、地域、市町、句、俳人、所在地、表裏面、建立者、建立年月、由来、緯度、経度、最終調査日

  • データ入手先(URL):

    • 三重県公式ウェブサイト「三重県内の句碑」https://www.bunka.pref.mie.lg.jp/Miebunka/search?cls=mica_kuhi

      • 同サイトではデータベースとしてキーワード検索ができ、検索結果から句碑の画像が表示できる。なお、地図上での表示ではない。
    • 上述のデータベースをオープンデータにしたものhttps://www.bunka.pref.mie.lg.jp/87741000001.htm

    • 下の方の「句碑等情報(CSV:147KB)」をクリックするとダウンロードできる。ファイル名は、000413659.csvである。
  • ライセンス:

    • 利用にあたっては、三重県「オープンデータの利用について」の規約、およびクリエイティブ・コモンズ・ライセンス(CC BY)の定めに準拠する。

[English]

R Code for Regional Analysis: Using Public Open Data to Visualize Haiku Monuments in Mie Prefecture with Leaflet and GSI Satellite 

Repository Description

This repository provides a prototype script for regional analysis and a reproducible data package that utilizes the "Haiku Monuments in Mie Prefecture" open data published by Mie Prefecture, performing spatial visualization using R (leaflet and dplyr). It implements a layer-toggling function between the Geospatial Information Authority of Japan (GSI) standard map and high-resolution satellite imagery, generating an interactive Web map that displays the "haiku" poem, date of establishment, and detailed origin/history beautifully structured within pop-ups at each monument's location. As another example of local governments providing open data on haiku or tanka monuments, Tottori Prefecture offers open data on Ozaki Hosai's haiku monuments (where the CSV includes latitude, longitude, and page numbers in the Hosai Hyakusen [Top 100 Hosai Poems] database: https://odp-pref-tottori.tori-info.co.jp/dataset/1641.html). This project serves as a practical example of open science that integrates and visualizes often-scattered local cultural resources from a Digital Humanities perspective. It aims to become a foundational template for the future development of Participatory GIS (PPGIS) and emotional mapping, which overlay subjective narratives (such as local residents' attachment and impressions) onto geospatial information.

While recent years have seen system-development approaches, such as research on nationwide platforms for utilizing haiku monument data using CIDOC CRM, LOD, and LLM/MCP servers (e.g., CiNii CRID 1050587970429961728), this repository possesses distinctive features and originality by directly leveraging public open data to provide a practical, reproducible, and open implementation example of "regional analysis" via R code. Technical assistance from Google Gemini was utilized to support the implementation of this code.

Version v2.2: Clarification of Attributions and Field-Oriented Cluster Disabling

In compliance with the official guidelines of the Geospatial Information Authority of Japan (GSI), a streamlined credit notation—"出典: 『地理院タイル』に『三重県内の句碑』を追記"—has been implemented in the bottom-right of the UI, eliminating redundant phrasing. Concurrently, based on empirical insights from field testing, a cluster suppression feature has been introduced. This logic minimizes the clustering radius and forces marker expansion during zooming, exposing individual markers even at a wide-area view except for extremely close-proximity locations, thereby enhancing intuitive spatial awareness and the comfort of local exploration on-site.

Version v2.1: Field Verification and Addition of Operational Screenshots

Field verification was conducted in an actual mobile environment to confirm the seamless coordinated operation between the GPS functionality and GSI layers. In addition, screenshots of the initial application screen, complete with organic timestamps, have been newly integrated as verification assets.

Notification of Version 2.0 Update

In the major update to Version 2.0, the application has been redesigned to transition from conventional desktop-based data analysis to focusing on practical utility during on-site fieldwork using smartphones and other mobile devices. Key functional enhancements include the implementation of automated and manual geolocation tracking via GPS integration. To ensure ease of operation on mobile screens, universal design considerations have been incorporated, such as enlarged markers and high-visibility cluster displays. Furthermore, anticipating environments with unstable network connectivity, a two-step design has been adopted: the application initially renders a wide-area view (zoom=11) at startup, and then shifts to a scale that facilitates surveying the surrounding environment (zoom=13) once the current location is determined.

Public Availability of Shiny Applications on the Web

To demonstrate the utility of the dataset and data preprocessing pipeline constructed in this study, a web-based interactive demo is publicly available at https://moteki.shinyapps.io/mie-haiku-monuments/. Although these applications are subject to a specific monthly active hour constraint, they have been verified to offer significantly more stable operation compared to self-hosted server deployments. In the event of temporary unavailability due to limit exhaustion or server maintenance, the data and source code can be downloaded from this repository to run the application in a local environment.

Demo of the GPS-enabled version: https://moteki.shinyapps.io/mie_kuhi_gps/

Data Description and Sources

  • Data Name: Haiku Monuments in Mie Prefecture (三重県内の句碑)

  • Provider: Mie Prefecture (Cultural Promotion Division, Department of Environment and Life)

  • Data Overview: A public open data set comprehensively covering the names, poems, locations, dates of establishment, origins, and geographic coordinates (latitude and longitude) for 302 haiku monuments dedicated to famous poets such as Matsuo Basho and Yamaguchi Seishi scattered or clustered throughout Mie Prefecture.

  • Main Columns (Data Schema):

    • Management Number (管理番号), Monument Name (句碑名), Region (地域), Municipality (市町), Poem (句), Poet (俳人), Location (所在地), Front/Back Inscription (表裏面), Builder (建立者), Date of Establishment (建立年月), Origin/History (由来), Latitude (緯度), Longitude (経度), Final Survey Date (最終調査日)

  • Data Availability (URLs):

    • Searchable Database: Mie Prefecture Official Website "Haiku Monuments in Mie Prefecture"

      https://www.bunka.pref.mie.lg.jp/Miebunka/search?cls=mica_kuhi

      (Note: This site allows keyword searching and displays images of the monuments from search results, but it does not support map-based visualization.)

    • Open Data Repository: https://www.bunka.pref.mie.lg.jp/87741000001.htm

      (Note: The raw data can be downloaded by clicking "Information on Haiku Monuments, etc. (CSV: 147KB)" [句碑等情報(CSV:147KB)] at the bottom of the page. The file name is 000413659.csv.)

  • License:

    • The usage of this data complies with the Mie Prefecture "Terms of Use for Open Data" and the Creative Commons Attribution License (CC BY).

Files

mie_initial_iPhone_V2_2.PNG

Files (16.3 MB)

Name Size Download all
md5:ca424fdfa5f6efb1576bbb2c8d75bcba
1.8 MB Preview Download
md5:a790abe2b3323b738a57b7732e3e72a2
1.6 MB Preview Download
md5:2da9b8ad3a95cc82de650e4645424b86
3.5 kB Download
md5:c1c98d339b9035135d1b86e51853174a
1.8 MB Preview Download
md5:9ff2f4cce649317c0939477cf268d2fc
1.7 MB Preview Download
md5:a7685e3bae1cb8c2f75b16d02e3a2141
2.0 MB Preview Download
md5:967f9b57b01cae5202b1674830fdfaba
3.8 MB Preview Download
md5:27bf8e2d6301b1e940c8db146aab5f70
7.5 kB Download
md5:7055c3c522fda7a5eaf3ab84842a782f
3.5 MB Preview Download

Additional details

Related works

Continues
Software: 10.5281/zenodo.20201920 (DOI)
Is continued by
Software: 10.5281/zenodo.20221729 (DOI)
Is documented by
Report: 10.5281/zenodo.20249186 (DOI)
Is original form of
Software: 10.5281/zenodo.20236497 (DOI)
Software: 10.5281/zenodo.20221729 (DOI)

Software

Programming language
R