#78: Iceland's places rank the settlement footprint, not the toponym register #91

Merged
art-bot merged 2 commits from issue-78-is-places-footprint into main 2026-08-09 15:56:39 +00:00
Owner

Closes #78


#78: Iceland's places rank the settlement footprint, not the toponym register — and settlement_points is retired

What changed

Iceland's places partition now ranks settlements by their built-up footprint. The
old partition read the whole LMÍ örnefni toponym register (44 506 points) and graded it
by örnefnaflokkurkenni, which is a category code (land/sea/water/ice + a Stórt/Mið/
Lítið sub-digit) rather than a size signal — so Ísland ranked 1, a skerry and a crater row
filled the top five, and Reykjavík did not make z7. The new source is mannvirki_flakar,
IS 50V's populated-place polygons, staged into PG (mannvirki_flakar); the rank orders
importance first, then the summed polygon area in EPSG:3057 (ISN2004, R88), then name.
Importance is cut from the same footprint (≥ 2 km² towns, ≥ 0.5 km² villages, else
hamlets), so the whole ladder is one signal. R82 is amended to record Iceland's
footprint exception — LMÍ's print-size code was a category code, so footprint (the
polygons' own geometry, not "from elsewhere") is the survey's genuine size call.

settlements/settlement_points are retired from conf/ismap.yaml, from the is
source list, and place_labels from html/style.json. The shared places layer now does
everything settlement_points did — the same ST_ClusterDBSCAN (eps 15 000 ≈ 6.5 km
ground, PARTITION BY nafnfitju) plus one centroid per (name, cluster), which keeps the
two Reykholt (67 km apart) two labels. One place-label layer per town remains
(place_names). The style drops from 65 to 64 layers.

Verification (live DB, post-import)

  • SELECT name FROM map_places_14 WHERE country='is' ORDER BY rank LIMIT 5 →
    Reykjavík, Hafnarfjörður, Kópavogur, Akureyri, Garðabær (the acceptance query).
  • The five broken register names (Ísland, Kolbeinsey, Sundhnúkur, 1000 manna hellir, ABC Garðurinn) are absent from map_places_14.
  • 110 places per zoom z9–z14, thinning 95/23/5/1/1 at z8/z7/z6/z5/z4; zero NULLs in
    name/importance/rank at every zoom; partitions present at all of z4–z14.
  • grep -c place_labels html/style.json is 0; gl-style-validate passes.
  • zxy_is no longer calls the retired layers.
  • Decoded tiles: z14 over Reykjavík returns the places layer with Reykjavík; z6 tile
    28/17 carries Reykjavík/Hafnarfjörður/Kópavogur/Garðabær; z5 shows only Reykjavík.
  • Real-browser render (CDP, mapsrv live): z5 shows Reykjavík alone with no
    place_labels layer; z9 shows only real towns (Keflavík, Akranes, Reykjavík, …).
  • make build; go test ./... in importer and mapsrv all pass.

Notes

  • make fetch-names and the databases: ornefni entry stay: the örnefni register
    remains the documented future source for naming water/peaks by spatial join (R93).
  • The old ismap_settlements_*/ismap_settlement_points_* tables and their zxy
    functions remain in the database, orphaned but harmless (same class as the pre-
    unification orphans of R27); nothing serves them. No destructive cleanup was run.
  • Keflavík/Njarðvík/Ásbrú share a combined population figure (21847) but have distinct
    footprints — another reason the rank uses footprint, not population.
Closes #78 --- #78: Iceland's places rank the settlement footprint, not the toponym register — and settlement_points is retired ## What changed **Iceland's `places` partition now ranks settlements by their built-up footprint.** The old partition read the whole LMÍ `örnefni` toponym register (44 506 points) and graded it by `örnefnaflokkurkenni`, which is a *category* code (land/sea/water/ice + a Stórt/Mið/ Lítið sub-digit) rather than a size signal — so Ísland ranked 1, a skerry and a crater row filled the top five, and Reykjavík did not make z7. The new source is `mannvirki_flakar`, IS 50V's populated-place polygons, staged into PG (`mannvirki_flakar`); the rank orders importance first, then the summed polygon area in EPSG:3057 (ISN2004, R88), then name. Importance is cut from the same footprint (≥ 2 km² towns, ≥ 0.5 km² villages, else hamlets), so the whole ladder is one signal. R82 is amended to record Iceland's footprint exception — LMÍ's print-size code was a category code, so footprint (the polygons' own geometry, not "from elsewhere") is the survey's genuine size call. **`settlements`/`settlement_points` are retired** from `conf/ismap.yaml`, from the `is` source list, and `place_labels` from `html/style.json`. The shared places layer now does everything settlement_points did — the same `ST_ClusterDBSCAN` (eps 15 000 ≈ 6.5 km ground, `PARTITION BY nafnfitju`) plus one centroid per (name, cluster), which keeps the two Reykholt (67 km apart) two labels. One place-label layer per town remains (`place_names`). The style drops from 65 to 64 layers. ## Verification (live DB, post-import) - `SELECT name FROM map_places_14 WHERE country='is' ORDER BY rank LIMIT 5` → **Reykjavík, Hafnarfjörður, Kópavogur, Akureyri, Garðabær** (the acceptance query). - The five broken register names (`Ísland`, `Kolbeinsey`, `Sundhnúkur`, `1000 manna hellir`, `ABC Garðurinn`) are absent from `map_places_14`. - 110 places per zoom z9–z14, thinning 95/23/5/1/1 at z8/z7/z6/z5/z4; zero NULLs in `name`/`importance`/`rank` at every zoom; partitions present at all of z4–z14. - `grep -c place_labels html/style.json` is 0; `gl-style-validate` passes. - `zxy_is` no longer calls the retired layers. - Decoded tiles: z14 over Reykjavík returns the places layer with Reykjavík; z6 tile 28/17 carries Reykjavík/Hafnarfjörður/Kópavogur/Garðabær; z5 shows only Reykjavík. - Real-browser render (CDP, mapsrv live): z5 shows Reykjavík alone with no `place_labels` layer; z9 shows only real towns (Keflavík, Akranes, Reykjavík, …). - `make build`; `go test ./...` in importer and mapsrv all pass. ## Notes - `make fetch-names` and the `databases: ornefni` entry stay: the örnefni register remains the documented future source for naming water/peaks by spatial join (R93). - The old `ismap_settlements_*`/`ismap_settlement_points_*` tables and their zxy functions remain in the database, orphaned but harmless (same class as the pre- unification orphans of R27); nothing serves them. No destructive cleanup was run. - Keflavík/Njarðvík/Ásbrú share a combined population figure (21847) but have distinct footprints — another reason the rank uses footprint, not population.
The audit against docs/country-requirements.md (#77) caught two defects in one
place. Iceland's `places` partition read the whole örnefni toponym register and
graded it by örnefnaflokkurkenni, which is a *category* code (land/sea/water/ice)
rather than a size signal — so Ísland ranked 1, Kolbeinsey 2, a crater row 3, and
Reykjavík did not appear at z7. Meanwhile every settlement name was drawn twice:
`place_labels` (`is`/`settlement_points`) and `place_names` (`map`/`places`) both
rendered text, and the legacy layer masked the broken one.

The fix is the shape Sweden landed in #29, applied to Iceland:

* `places` now reads the IS 50V populated-place polygons (mannvirki_flakar,
  fitjuflokkur=104), staged into PG as `mannvirki_flakar`. The rank orders
  importance first, then the settlement's built-up footprint — the summed polygon
  area in EPSG:3057, the ISN2004 national grid (R88; the layer's own EPSG:3857
  area inflates ~5x at 64°N and would reorder the towns) — then name. Importance
  is cut from the same footprint (≥ 2 km² towns, ≥ 0.5 km² villages, else
  hamlets), so the whole ladder is one signal. Reykjavík is rank 1 (39 km²) and
  the top five are the five real cities.
* `settlements`/`settlement_points` are retired from conf/ismap.yaml, from the
  `is` source list, and `place_labels` from html/style.json. The shared places
  layer does what settlement_points did — the same ST_ClusterDBSCAN (eps 15 000
  ≈ 6.5 km ground, PARTITION BY nafnfitju) plus one centroid per (name, cluster),
  keeping the two Reykholt (67 km apart) two labels — so one label layer remains.

R82 is amended to record the footprint exception: LMÍ's print-size code was a
category code, so the polygons' own geometry is the survey's genuine size call,
not a signal "pulled from elsewhere". The örnefni register stays fetchable as the
future source for naming water and peaks by spatial join (R93).

Verified against the live DB after reimporting the Iceland places partition:
the acceptance query returns Reykjavík, Hafnarfjörður, Kópavogur, Akureyri,
Garðabær; the five broken register names are gone; 110 places at z9+ thinning
95/23/5/1/1 through z8/z7/z6/z5/z4 with zero NULLs in name/importance/rank;
`grep -c place_labels html/style.json` is 0; `gl-style-validate` passes; zxy_is
no longer serves the retired layers; decoded tiles and a real-browser CDP render
both show only real towns, with Reykjavík the sole label at z5.
art changed title from Closes #78 to #78: Iceland's places rank the settlement footprint, not the toponym register 2026-08-09 14:39:30 +00:00
The shared importance comment still named the 1-3 tiers after the örnefni
category code, which this branch retires as a size signal. Name the tiers for
what they are and list each country's own signal, keeping the örnefni note as
the reason Iceland is R82's exception.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!91
No description provided.