#81: Finland's stations get their importance-3 rung, and Helsinki's metro its stops #99
No reviewers
Labels
No labels
blocked
claude-wip
map-report
map:is
map:se
needs-review
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
art/ismap!99
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-81-fi-stations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #81
Finland's stations get their importance-3 rung, and Helsinki's metro its stops
What and why
Two R-failures from the #77 audit, both fixed in the
stationslayer(
conf/fimap.yaml):1. The empty importance-3 rung (R75/R76). Finland's only station-importance signal
was name-present-vs-absent, which fills rungs 1 and 2 and can never reach 3 — so
map_stations_9_fiwas an empty partition and Finland's stations started at z11 nextto Sweden's z9. This is exactly #68, which Poland's note said would generalize. The
recipe, applied: a rail station is importance 3 iff it is the principal station of a
city the MML register prints at its top display tier —
kohdeluokka 48111/48112,the large-font towns the
placeslayer scores 3, from the samefi_paikannimi_clstaging table (same staging, same "which places matter" judgement). The principal is
the station named exactly after the town, one per town via
DISTINCT ON(everymatched town has exactly one such station, so the dedupe is a guard, not a choice).
112 towns match (the #68 note's "69 sites" was measured without the R94 casing
normalisation; with it, and with both 48111+48112 as the top tier the way
placesscores them, the count is 112). The station-name side of the match needed the R94
casing normalisation the places/railways layers already apply — the 14201 register
stores most rows in capitals — so the rail branch now initcaps all-caps register
names (HELSINKI → Helsinki), which also fixes the shouting labels the layer used to
emit. Tram 1, metro 2, rail 2/3 as before; only the rung-3 derivation is new.
2. Metro lines with no metro stations (R70), and the R6 answer. The stops were
never unavailable — MTK's own
rautatieliikennepaikkaclass carries 25 of them(Kamppi, Ruoholahti, Rautatientori, Tapiola, …: all 25 lie within 100 EPSG:3857
units of a metro segment, next nearest site is Helsinki main at 335, so a 200-unit
cut separates them cleanly) — but the class stops at Matinkylä: Finnoo, Kaitaa,
Soukka, Espoonlahti and Kivenlahti (open since 2022-12, and present as 14201
labels) have no 14200 site even in the April 2025 vintage. Checked against the
full product lists per R6: MML's Maastotietokanta has no more metro sites than the
theme file we already fetch; HSL's GTFS (the Helsinki region authority's official
static timetable,
https://infopalvelut.storage.hsldev.com/gtfs/hsl.zip, open dataCC BY 4.0) has every station. So the new source is HSL's GTFS: a
downloads:entry(the
?download=1trick keeps the zip whole, as with Poland's feeds), afi_gtfs_metro_stopsstaging table via the existing GTFS stops loader (route_type 1,platforms collapsed to parent stations), and a metro branch in the
stationsquery.All 30 metro stations now import. The 25 MTK metro sites are excluded from the rail
branch (
NOT EXISTSagainst a 14131 segment within 200 units) rather than re-labelled,so no station draws twice — 0 rail rows sit within 200 units of a metro line after the
reimport.
HSL supplies the geometry, the register supplies the name (review fix, commit 2).
The feed's stop names are operational rather than cartographic: every one reads
"<town>n metroasema" — a genitive stem plus the words "metro station" — so taking
them verbatim labelled all 30 stations "Kampin metroasema", "Rautatientorin
metroasema", where Stockholm draws
Karlaplanand WarszawaCentrum, in a form thatdoes not even match the place name beside it. The metro branch therefore runs the
same 14201 register lookup the rail branch runs, anchored on the HSL point instead
of the MTK site, and all 30 resolve: Kampin metroasema →
Kamppi, Kivenlahdenmetroasema →
Kivenlahti, Koivusaaren metroasema →Koivusaari. A name join ratherthan a suffix strip, because stripping
" metroasema"would leave the genitive("Kampin").
COALESCEkeeps the feed name as the fallback for a station opened beforethe register catches up; it fires on nothing today.
R74, documented rather than guessed. 176 of the 559 traffic sites had no register
name before this issue; after it, 175 — Koivusaari's MTK site is one of the 25 the
metro exclusion removes, and its HSL point finds the register's "Koivusaari" label. The
country doc now states what they are: MTK operating points the 14201 register does
not label — junctions, passing loops and goods yards, the same population as the
named ", TAVARA" sites (Hanko, Tavara; Hyvinkää, Tavara — "tavara" is Finnish for
goods). Genuinely unnamed source features, not a dropped-name bug.
Verification (live DB, after
-layer stationsreimport)SELECT importance, count(*) FROM map_stations_14_fi GROUP BY 1→ 1:463, 2:277,3:112 — no gap 1..3 (the issue's acceptance query).
map_stations_9_fi→ 112 (was 0), one principal per top-tier town; z9 tile overHelsinki decodes to Helsinki/Espoo/Kauniainen; z10/z11 389, z12+ 852.
map_stations_14_fimode='metro' → 30 rows, min distance to the metroline 0.23 units, max 131 (all on the line); 0 rail rows within 200 units of a metro
segment (no double-draw); 0 NULL
importance; no NULL names in metro/tram, 175 NULLin rail (the documented R74 set); partitions present at z9–z14.
metro, 0 names carrying "metroasema", the register names present (Kamppi,
Koivusaari, Keilaniemi, Hakaniemi …) alongside the rail ones (Helsinki, Ilmala,
Huopalahti …).
scripts/cdp-map-check.mjs, never virtual time): z9 overHelsinki draws 8
station_dots(all rail, the principals); z11 draws 40 dots — 22metro + 18 rail — with 3 metro labels placed; the blue metro dots sit on the blue
metro line.
map_stations_142059/4052,map_stations_9485/60, same asbefore the reimport.
make build,go test ./...importer/ + mapsrv/ green;git diff --checkclean.Left undone / notes for the reviewer
path; the file is cached with a
.fetchmetasidecar like every other download.both recorded in
docs/country-finland.md:(metro + tram, 150 m and 290 m apart, genuine interchanges) and Vuosaari (metro
station vs harbour goods yard, 2.6 km apart, genuinely two places). Sweden already
has 107 such pairs, so this is the house pattern, not a collision to fix.
and "Helsingin Yliopisto", where Finnish wants a lower-case second word. 47 of the
register's all-caps 14201 labels are multi-word and so exposed to it. Fixing it
needs Finnish-aware casing rules and would touch
placesandrailwaystoo, so itstays one documented limit of the shared R94 idiom rather than a per-layer patch.
register's own HELSINKI site); metro stations are rung 2 like Sweden's and
Poland's, so they draw from z11, not z9.
unique_iconstays NULL (R72) — no network badge, plain dots, unchanged.rail_classbranch (#69'sVäylä rail data), bus stops (future bus-stop layer).
b506fb2b0atob3cee2ea08