diff --git a/wip/274-method.md b/wip/274-method.md new file mode 100644 index 0000000..2926679 --- /dev/null +++ b/wip/274-method.md @@ -0,0 +1,215 @@ +--- +title: 274 - how the roster was built +categories: + - Songwriting notes +wiki: + publish: false +--- + +# 274: how the roster was built + +This is the provenance document for the 川端橋–右左府 roster and the interactive +transect page. The roster itself lives in [274 reference tables](274-dev.md); the song +page is [274](274.md). + +Nothing here is authoritative about the road. It is a record of where each number came +from, which numbers are derived rather than measured, and which were corrected by hand +against reality. + +## What exists + +| File | What it is | +|---|---| +| `274-dev.md` | The roster. 168 entries, 37.27–107.83 km, 26 kinds, 95 distinct names, 118 with readings. Source of truth. | +| `274-lookup.csv` | The same rows, 16 columns, generated from the Markdown. | +| `274-lookup.geojson` | The same rows as points, plus the route line and the district bands. | +| `274-transect.html` | Self-contained interactive page. Opens from disk; also published as an Artifact. | +| `274-route.json` | 1,715 route points with their kilometre. | +| `274-districts.json` | 23 大字 bands with entry and exit kilometres. | +| `274-transect-build.py` | Re-reads the roster and rewrites the page's data block. | +| `274-romaji.py` | Fills the Romaji column from the Kana column. | + +Flow is one-way: **`274-dev.md` → everything else.** Editing a generated file is pointless; +it will be overwritten on the next build. + +## Scope + +The range is **川端橋 (37.27 km) to 右左府 (106.22 km)**, chosen by the author, not derived. + +- West end at the bridge rather than the settlement: 川端's substance lies upstream, west + of the bridge, and is deliberately outside the frame. The JR station was excluded for + the same reason and later re-added. +- East end at 右左府 — 発電所, 変電所 and the transmission line 右左府線 — after which the + road continues east out of the piece. +- Everything beyond is out of scope: 千呂露橋, 大颱橋, the whole of 日勝峠, the Tokachi + descent. Full-route material stays in the KB at `~/infra/kb/inbox/surreal/md/`. + +Two entries sit past the nominal east end (滝の沢川 107.29, ルウケシオマナイ川 107.83) +because they fell inside the computation window; they are not part of the intended range. + +## Sources + +**北海道開発局 個別施設計画, 令和8年3月** — the national facility registers, three PDFs: +橋梁長寿命化修繕計画, 道路トンネル個別施設計画, 大型の構造物個別施設計画. Gives every bridge, +tunnel and shed with length, width, type, build year, inspection year and 判定区分. No +coordinates and no kilometrage. Text extracted with pypdf; columns reconstructed by +anchoring on the inspection year and grade at the right and the bureau/office at the left. +**Not checked against the original page images.** + +**OpenStreetMap** (ODbL, retrieved 2026-09-08/09) — the route geometry, and most points of +interest. Route relation `r6651380`. Reading tags `name:ja-Hira` and `name:ja-Latn` where +they exist, which was 42 of the original 170 rows. + +**国土数値情報 河川データセット (W05)** via the Geoshape repository at 国立情報学研究所 — +watercourse names and geometry for the 石狩川, 鵡川 and 沙流川 systems. All 561 named rivers +were fetched, not only the 「その他」 group: named rivers carry their own 河川コード and are +served separately, which is the mistake that caused the first pass to miss 夕張川, 鵡川, +沙流川, 穂別川, サヌシュッペ川, both ウシャップ rivers and ホルカクルキ川. + +**国土地理院 逆ジオコーディング** — `mreversegeocoder.gsi.go.jp`. Coordinate to municipality +code and 大字. Joined to GSI's `muni.js` for the municipality name including the 郡. + +**日本郵便 郵便番号データ** (Hokkaido file, CP932) — kana readings for municipality and +町域, folded from half-width katakana to hiragana. + +**route01.com r274p2–p4** and **hgf03030.a.la9.jp** — two drivers' 2019 trip reports. The +only source for structure *order*, which the registers do not carry. Also the source for +several details no dataset has: the painted-out hexagon on the 道道610 sign, the bear +statue at the drive-in, the 合目 markers restarting on the Shimizu side. + +**Google Maps** — via the author, for everything OSM lacks. See below. + +## Method + +**Kilometre datum.** A node graph is built from the ways of the OSM route relation. +Dijkstra from a seed node gives distance along the road for every node. The relation is +broken across the divided-carriageway stretch in 札幌, so the seed is the west end of the +largest connected component, near 上野幌 — **not the official start**. Comparison against +KP values in a 帯広開発建設部 disaster report suggests official KP ≈ these figures + 14 km, +unverified. One kilopost read on Street View would settle it. Everything downstream — +ordering, district bands, offsets — is internally consistent regardless. + +**Point features** are projected to their nearest route node; the offset column is the +straight-line distance from feature to road. + +**Structures** have no coordinates in the registers, so their positions are derived two +ways. First, OSM tags each bridge and tunnel as its own way, giving a position and a +geometric length; aligning that ordered sequence against the registers' ordered lengths by +Needleman–Wunsch transfers the positions. 穂高トンネル lands within 9 m. Second, where a +bridge is named after the watercourse it crosses, the geometric crossing point gives an +independent position that overrides the alignment — this fixed 草木橋, ポン久留喜橋, +オロロップ橋, モトツ橋, 福山大橋 and 新川橋. + +The alignment is reliable in the 60–97 km core, where tunnels anchor it, and unreliable at +both ends where small bridges cluster and OSM ways do not correspond one-to-one. 唐沢橋 +(9.1 m) and 福本沢川橋 (3.0 m) have no position at all — below the size OSM splits out. + +**Watercourses** are positioned at closest approach, which equals the crossing for streams +the road crosses and is arbitrary for streams it runs beside. サヌシュッペ川 is tangent at +two reaches 5 km apart for this reason; 沙流川 is placed where the road joins its valley +at 右左府, not at its nearest point, which falls past the range end. + +**District bands** come from reverse-geocoding the road itself every 250 m — 287 samples +producing 23 bands with entry and exit kilometres. This is the only method here that can +say where the road enters and leaves a district; point data cannot, because representative +points sit at settlement centres. + +**Name extraction** strips generic tails (橋, 川, トンネル, 覆道, 郵便局, 発電所, 町, 丁目), +strips the Ainu qualifiers パンケ/ペンケ/ポン, and aliases variants together (十三哩→十三里, +滝ノ上→滝の上, 浪ノ沢→浪の沢, 能見→熊見, クルキ→久留喜). Mechanical and meant to be corrected. + +**Romaji** is generated from kana, never from kanji, in wāpuro style — おう→ou, ゅう→yuu, +っ doubles, ー repeats, ん→n' before a vowel or y. The trailing generic is split off and +lowercased. Kana is the source of truth; where kana is blank, romaji stays blank. + +## Human in the loop + +The machine-derived roster was wrong in ways no amount of cross-referencing would have +caught. Every item below came from the author reading signs, satellite imagery and Street +View, or from knowledge not in any dataset. + +**Corrections to derived data** + +- **十三哩橋 / 十三里橋** — the register writes 哩, the kanji for *mile*; the plate on the + bridge reads 里. Confirmed on Street View. As a place name it is read **とみさと**. The + origin is the 13-mile post from 追分駅, so the name runs mile → ri → hamlet, and the + register is the only place the mile survives. +- **ホルカクルキ川** — I claimed it had no counterpart in W05. It does, 河川コード + 8101030169; I had fetched only 12 of 561 named rivers. The 北海道 plate on the bank + confirms the spelling and gives the Ainu original **ホロカ・クルヒ (horka・kurihi)**, + "to turn back" and "its shadow" — *horka* marks a stream running counter to its parent. + route01's ホロカクルキ is a slip. +- **モトツ橋** — I had it at 86.16 km on the パンケモトツ沢川 crossing. It is at 87.12, + the sheltered span between モトツトンネル and 福山トンネル. The identical 62 m lengths of + bridge and shelter are the same deck, not a coincidence. Street View and satellite, + July 2025: the two tunnels now read as continuous. +- **下福山橋 and オロロップ橋** — order swapped by the author to 77.05 / 77.55, matching + route01 against my length-alignment. +- **滝ノ上信号場** — demoted from passenger station in 2024. Not in any dataset consulted. +- **登川** — the active community now falls under 楓 jurisdiction; 登川 is largely the + administrative remnant of Yubari's first settlements. This explains why 登川神社, 登川橋 + and 登川郵便局 all geocode to 夕張市楓 while the district called 登川 begins further east. +- **穂別ダム神社** belongs to 穂別長和 — the dam and reservoir are in that district and only + the shrine fell the wrong side of an old boundary. **稲里神社**, the proper shrine for + 穂別稲里, is too far inland to reach from R274. Neither fact is derivable from the + geocoded address, which reports only where each thing physically sits. + +**Found by hand, absent from OpenStreetMap** + +滝下八幡神社 · 滝下発電所 · 登川神社 · 豊進神社 · 穂別ダム神社 · 福山神社 · 名石駐車場 · +日高神社 · 日高発電所 · 右左府発電所 + +Ten entries, all located from Google Maps pins resolved to coordinates, then positioned +against the route and geocoded like any other row. OSM carried two of the eight shrines. +A shrine 18 m from the carriageway (穂別ダム神社) was missing, so the shrine count is a +floor rather than a total, and parking and rest areas are effectively unmapped along the +whole route — 名石駐車場 came through only because it has a Google place listing. + +**Judgement calls** + +Readings were filled by hand and are not all guaranteed; the plaques will settle the +doubtful ones. Rivers are being skipped. Shops, restaurants, bus stops, temples, fuel +stations, campsites and hotels were removed deliberately. 名称不明, ベリベツ川 and +デチン沢川 were excluded with reasons recorded. A vacant Seicomart was rejected as an entry +and read instead as a relocation to the shop 859 m away. + +## Errors found and fixed + +Recorded because they indicate where this kind of pipeline fails. + +- **Duplicate-named features shared one set of coordinates.** A name-keyed lookup meant + both セイコーマート pointed at the same spot 50 km apart; likewise three ENEOS and paired + bus stops. 12 coordinate cells were wrong. +- **穂高トンネル is 1,991 m long and was built in 1991.** The parser took the first + year-shaped token and grabbed the length. Fixed by anchoring build year and age from the + row end. The only such collision on the route. +- **W05 coverage** — see ホルカクルキ川 above. Assuming the 「その他」 group was the whole + dataset produced a confident false negative. +- **Over-stripping** — 登川 reduced to 登, and のぼりかわ romanised as "Nobori kawa", because + a trailing 川 looks generic. Both are toponyms where it is integral. +- **A table column mismatch** in the page: a header change applied while its matching cell + insert silently did not, shifting every column right of Kana by one. +- **A join key type mismatch** left the 大字 column empty in a committed CSV. + +## Limits + +- Distances are **not official kiloposts**. +- Structure positions are derived, not surveyed. Two have none at all. +- Register figures are not checked against the original page images. +- Shrine and parking coverage is a floor, not a total. +- The roster records where each object physically sits. It cannot express which community + an object belongs to — that distinction lives in the prose. +- The underlying 全国道路施設点検データベース restricts commercial use and copying of the + dataset. Facility names and build years are facts; wholesale redistribution of the tables + is not. + +## Regenerating + +```sh +python3 wip/274-romaji.py --check # dry run: report romaji differences +python3 wip/274-romaji.py # fill the Romaji column from Kana +python3 wip/274-transect-build.py # rewrite the page's data block +``` + +Both are stdlib-only and idempotent. The CSV, the GeoJSON and the published Artifact are +regenerated from the same Markdown by hand.