Add sub-national regional dataset + generator (v0.11.0) #25

Merged
kamilkrzywda merged 1 commits from feat/sub-national-regions into master 2026-10-12 02:47:22 +02:00
Owner

Part of #16

Adds the sub-national regional dataset and its deterministic generator as the foundation for splitting the map into much smaller regions (#16).

  • scripts/generate-regions.mjs (dependency-free): subdivides each country into adaptive ~100-200 km regions (few-to-tens each; bigger for vast/sparse areas like Siberia/Sahara) by clipping a local square grid to the country geometry. Countries crossing the antimeridian stay a single region for v1.
  • public/regions.geo.json (committed): 2,597 regions across 177 countries (~755 KB), each id = <ISO_A3>-<nn> with properties.parent = the parent country.
  • scripts/regions.test.ts: validates the dataset (valid GeoJSON, id/parent format, per-country count band 1-36 with >=2 for area > 50,000 km2, sane region sizes, tiling coverage ~[45%,108%]).
  • No app behavior change yet — the map still uses countries.geo.json. PR 2 switches the map + ownership to this dataset.

Part 1 of 3 for #16 (dataset -> map/ownership -> sub-region-level transfers).

Part of #16 Adds the sub-national regional dataset and its deterministic generator as the foundation for splitting the map into much smaller regions (#16). - `scripts/generate-regions.mjs` (dependency-free): subdivides each country into adaptive ~100-200 km regions (few-to-tens each; bigger for vast/sparse areas like Siberia/Sahara) by clipping a local square grid to the country geometry. Countries crossing the antimeridian stay a single region for v1. - `public/regions.geo.json` (committed): 2,597 regions across 177 countries (~755 KB), each `id = <ISO_A3>-<nn>` with `properties.parent` = the parent country. - `scripts/regions.test.ts`: validates the dataset (valid GeoJSON, id/parent format, per-country count band 1-36 with >=2 for area > 50,000 km2, sane region sizes, tiling coverage ~[45%,108%]). - **No app behavior change yet** — the map still uses `countries.geo.json`. PR 2 switches the map + ownership to this dataset. Part 1 of 3 for #16 (dataset -> map/ownership -> sub-region-level transfers).
kamilkrzywda added 1 commit 2026-10-12 02:38:35 +02:00
Add sub-national regional dataset + generator (v0.11.0)
CI / build + unit + e2e (pull_request) Successful in 1m21s
d5285ce28d
Fixes #16
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-10-12 02:47:21 +02:00
kamilkrzywda merged commit 344b5b4a5e into master 2026-10-12 02:47:22 +02:00
kamilkrzywda deleted branch feat/sub-national-regions 2026-10-12 02:47:22 +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#25