Finland's station labels are all-caps — R94 applies to stations too #92

Closed
opened 2026-08-09 16:08:45 +00:00 by art-bot · 1 comment
Collaborator

Finland's station labels come off the MML register verbatim, and the register stores most of
its traffic-site rows in capitals. 349 of 847 fi station names are all-caps:

SELECT count(*) total,
       count(*) FILTER (WHERE name = upper(name) AND length(name) > 3) all_caps
FROM map_stations_14 WHERE country = 'fi';
-- total 847, all_caps 349

The source is fi_paikannimi kohdeluokka 14201, of which 620 of 767 rows are capitalized:

SELECT count(*), count(*) FILTER (WHERE teksti = upper(teksti) AND length(teksti) > 3)
FROM fi_paikannimi WHERE kohdeluokka = 14201;
-- 767, 620

This is R94 ("Normalize names to the register's display casing"), the same finding #80 fixed for
places. The stations layer in conf/fimap.yaml takes n.teksti AS name straight out of the
lateral join with no normalization.

What to do

Apply the idiom #80 landed on main for the places query, to the station name:

(CASE WHEN n.teksti = upper(n.teksti) THEN initcap(n.teksti) ELSE n.teksti END) AS name

Note the known initcap limit recorded in conf/fimap.yaml's places comment: it breaks a word at
every non-alphanumeric character, so S:T MICHEL comes back as S:T Michel. The 14201 series
carries those rows, so the same handful of names is affected here.

Why now

#86 (PR #88) wires the same 14201 join into railways and was sent back for exactly this — once
it is fixed, stations would be the only Finnish label layer still shouting. Worth doing in the
same pass or immediately after.

Acceptance

SELECT count(*) FROM map_stations_14
WHERE country = 'fi' AND name = upper(name) AND length(name) > 3;

Near zero — allowing the S:t rows above, which are not all-caps after normalization anyway.
Check no other country's station names changed, and that the station count is unchanged (this is
a casing fix, not a dedupe).

Found reviewing PR #88 / #90.

Finland's station labels come off the MML register verbatim, and the register stores most of its traffic-site rows in capitals. 349 of 847 fi station names are all-caps: ```sql SELECT count(*) total, count(*) FILTER (WHERE name = upper(name) AND length(name) > 3) all_caps FROM map_stations_14 WHERE country = 'fi'; -- total 847, all_caps 349 ``` The source is `fi_paikannimi` kohdeluokka 14201, of which 620 of 767 rows are capitalized: ```sql SELECT count(*), count(*) FILTER (WHERE teksti = upper(teksti) AND length(teksti) > 3) FROM fi_paikannimi WHERE kohdeluokka = 14201; -- 767, 620 ``` This is R94 ("Normalize names to the register's display casing"), the same finding #80 fixed for `places`. The `stations` layer in conf/fimap.yaml takes `n.teksti AS name` straight out of the lateral join with no normalization. ## What to do Apply the idiom #80 landed on `main` for the places query, to the station name: ```sql (CASE WHEN n.teksti = upper(n.teksti) THEN initcap(n.teksti) ELSE n.teksti END) AS name ``` Note the known `initcap` limit recorded in conf/fimap.yaml's places comment: it breaks a word at every non-alphanumeric character, so `S:T MICHEL` comes back as `S:T Michel`. The 14201 series carries those rows, so the same handful of names is affected here. ## Why now #86 (PR #88) wires the same 14201 join into `railways` and was sent back for exactly this — once it is fixed, `stations` would be the only Finnish label layer still shouting. Worth doing in the same pass or immediately after. ## Acceptance ```sql SELECT count(*) FROM map_stations_14 WHERE country = 'fi' AND name = upper(name) AND length(name) > 3; ``` Near zero — allowing the `S:t` rows above, which are not all-caps after normalization anyway. Check no other country's station names changed, and that the station count is unchanged (this is a casing fix, not a dedupe). *Found reviewing PR #88 / #90.*
art-bot self-assigned this 2026-08-09 16:08:45 +00:00
Author
Collaborator

Done — closed by #81 (PR #99, merged 2026-08-13 as b667481 + b3cee2e), which applied
this exact idiom without referencing this issue.

Not a coincidence, and worth recording why: #81 needed the R94 normalisation for its
own reasons. Its importance-3 rung matches a station name against the top-tier town
list, and that list is already normalised in fi_paikannimi_cl, so the station side had
to be normalised identically or the match would not fire. Unnormalised it found 69
sites; normalised, 112. (That is also the explanation for the discrepancy between #68's
"69 sites" estimate and #81's "112 towns".) This issue's fix was load-bearing for that
one, and fell out of it.

Acceptance query, live DB after the merge:

SELECT count(*) FROM map_stations_14
WHERE country = 'fi' AND name = upper(name) AND length(name) > 3;
--  349  →  2

The two survivors are TAYS A and TAYS B, and they are not a casing bug:
TAYS is an acronym (Tampereen yliopistollinen sairaala), it is genuinely upper-case, and
those are Tampere tram stops taking their name from Digiroad's already-cased
NIMI_SU — not from the 14201 register this issue diagnosed. Nothing to normalise.

The other check passes too: no other country's station names moved, map_stations_14
still 2 059 (se) / 4 052 (pl). Finland went 847 → 852 rows for reasons documented in
#81 — 25 MTK metro sites left the rail branch as duplicates of the 30 HSL metro
stations (559 + 288 → 534 + 30 + 288).

One prediction here did not materialise. This issue expected the register's
S:T MICHEL-style rows to come back as "S:T Michel". There are now zero S:-prefixed
Finnish station names, and zero mixed-case 14201 rows containing a run of capitals — the
traffic-site series does not carry those rows, whatever the places series does.

The underlying initcap limit this issue flagged and accepted is now tracked on its own
as #113, including the S:T MICHEL shape.

Done — closed by #81 (PR #99, merged 2026-08-13 as b667481 + b3cee2e), which applied this exact idiom without referencing this issue. Not a coincidence, and worth recording why: #81 needed the R94 normalisation for its own reasons. Its importance-3 rung matches a station name against the top-tier town list, and that list is already normalised in `fi_paikannimi_cl`, so the station side had to be normalised identically or the match would not fire. Unnormalised it found 69 sites; normalised, 112. (That is also the explanation for the discrepancy between #68's "69 sites" estimate and #81's "112 towns".) This issue's fix was load-bearing for that one, and fell out of it. **Acceptance query, live DB after the merge:** ```sql SELECT count(*) FROM map_stations_14 WHERE country = 'fi' AND name = upper(name) AND length(name) > 3; -- 349 → 2 ``` The two survivors are **`TAYS A`** and **`TAYS B`**, and they are not a casing bug: TAYS is an acronym (Tampereen yliopistollinen sairaala), it is genuinely upper-case, and those are Tampere **tram** stops taking their name from Digiroad's already-cased `NIMI_SU` — not from the 14201 register this issue diagnosed. Nothing to normalise. The other check passes too: no other country's station names moved, `map_stations_14` still 2 059 (se) / 4 052 (pl). Finland went 847 → 852 rows for reasons documented in #81 — 25 MTK metro sites left the rail branch as duplicates of the 30 HSL metro stations (559 + 288 → 534 + 30 + 288). **One prediction here did not materialise.** This issue expected the register's `S:T MICHEL`-style rows to come back as "S:T Michel". There are now zero `S:`-prefixed Finnish station names, and zero mixed-case 14201 rows containing a run of capitals — the traffic-site series does not carry those rows, whatever the places series does. The underlying `initcap` limit this issue flagged and accepted is now tracked on its own as **#113**, including the `S:T MICHEL` shape.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
art/ismap#92
No description provided.