Use real historical sub-national regions instead of the geometric grid (v0.13.0) #27

Merged
kamilkrzywda merged 1 commits from feat/historical-regions into master 2026-10-12 10:43:09 +02:00
Owner

Part of #16

Replaces the abstract geometric-grid division (v0.11/v0.12) with real named sub-national administrative regions from Natural Earth admin-1 (1:10m, public-domain), as requested ("use historical regions, not a geometric grid").

  • public/regions.geo.json is now 4,138 real regions (states, provinces, governorates, oblasts — e.g. US-CA California, FR-75 Paris, RU-MOW Moskovskaya) covering all 177 countries (~2.8 MB after Douglas–Peucker simplification; the raw 4-decimal geometry was ~23 MB).
  • scripts/generate-regions.mjs (dependency-free, npm run generate:regions) regenerates it from NE admin-1 grouped by adm0_a3; ids are ISO 3166-2 with a <ISO_A3>-<nn> fallback and within-country disambiguation; output stays { name, parent } (parent = ISO_A3).
  • scripts/regions.test.ts rewritten to validate the new dataset (well-formed, unique ids, all-177-covered, sane areas).

No map/engine/LLM changes — the choropleth already resolves each region's owner via properties.parent, so it now paints the real regions by their country's owner automatically.

Granularity note: median ~15 regions/country (few-to-tens); a few countries are finer (UK 232, Slovenia 193, Latvia 119, Italy 110, France 101, Russia 86) because NE 1:10m includes finer administrative units for them. Coarsening those is a possible follow-up if desired.

Part of #16 (replaces the v0.11/v0.12 geometric grid; sub-region-level LLM transfers remain a separate follow-up).

Part of #16 Replaces the abstract geometric-grid division (v0.11/v0.12) with **real named sub-national administrative regions** from Natural Earth admin-1 (1:10m, public-domain), as requested ("use historical regions, not a geometric grid"). - `public/regions.geo.json` is now **4,138 real regions** (states, provinces, governorates, oblasts — e.g. `US-CA` California, `FR-75` Paris, `RU-MOW` Moskovskaya) covering **all 177 countries** (~2.8 MB after Douglas–Peucker simplification; the raw 4-decimal geometry was ~23 MB). - `scripts/generate-regions.mjs` (dependency-free, `npm run generate:regions`) regenerates it from NE admin-1 grouped by `adm0_a3`; ids are ISO 3166-2 with a `<ISO_A3>-<nn>` fallback and within-country disambiguation; output stays `{ name, parent }` (parent = ISO_A3). - `scripts/regions.test.ts` rewritten to validate the new dataset (well-formed, unique ids, all-177-covered, sane areas). **No map/engine/LLM changes** — the choropleth already resolves each region's owner via `properties.parent`, so it now paints the real regions by their country's owner automatically. Granularity note: median ~15 regions/country (few-to-tens); a few countries are finer (UK 232, Slovenia 193, Latvia 119, Italy 110, France 101, Russia 86) because NE 1:10m includes finer administrative units for them. Coarsening those is a possible follow-up if desired. Part of #16 (replaces the v0.11/v0.12 geometric grid; sub-region-level LLM transfers remain a separate follow-up).
kamilkrzywda added 1 commit 2026-10-12 10:39:20 +02:00
Replace geometric sub-regions with real historical regions (v0.13.0)
CI / build + unit + e2e (pull_request) Successful in 2m34s
99188b5b15
Part of #16
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-10-12 10:43:07 +02:00
kamilkrzywda merged commit db46e1a5ec into master 2026-10-12 10:43:09 +02:00
kamilkrzywda deleted branch feat/historical-regions 2026-10-12 10:43:09 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/History#27