Coarsens the real sub-national regions so no region is smaller than ~100×100 km (10,000 km²), except islands — per the request to “join cities to the region around it.”
New scripts/coarsen-regions.mjs (npm run coarsen:regions): merges small same-country regions into their nearest surrounding neighbor using real boolean dissolves (@turf/union), cascading smallest-first to a fixed point. Regions with no same-country neighbor (islands) are left alone.
public/regions.geo.json: 4,138 → 1,796 regions (2,342 merged). Over-granular countries collapse to a few-to-tens: UK 232→16, Italy 107→19, France 110→42, Russia 200→80; median is now 7/country. Standalone cities are absorbed (Paris → Val-de-Marne cascade, London districts, DC → Maryland). 83 island regions are exempted from the floor.
@turf/union added as a devDependency (used only by the generator script, not the app bundle).
scripts/regions.test.ts +1 test (non-island regions below the floor < 1% of the dataset).
Map/LLM contract unchanged — WorldMap.tsx still resolves ownership via properties.parent, so the coarser data just renders coarser regions.
Part of #16 (the LLM sub-region-transfer piece is still pending).
Part of #16
Coarsens the real sub-national regions so no region is smaller than ~100×100 km (10,000 km²), except islands — per the request to “join cities to the region around it.”
- New `scripts/coarsen-regions.mjs` (`npm run coarsen:regions`): merges small same-country regions into their nearest surrounding neighbor using **real boolean dissolves** (`@turf/union`), cascading smallest-first to a fixed point. Regions with no same-country neighbor (islands) are left alone.
- `public/regions.geo.json`: 4,138 → **1,796 regions** (2,342 merged). Over-granular countries collapse to a few-to-tens: **UK 232→16**, Italy 107→19, France 110→42, Russia 200→80; median is now **7/country**. Standalone cities are absorbed (Paris → Val-de-Marne cascade, London districts, DC → Maryland). **83 island regions** are exempted from the floor.
- `@turf/union` added as a devDependency (used only by the generator script, not the app bundle).
- `scripts/regions.test.ts` +1 test (non-island regions below the floor < 1% of the dataset).
- **Map/LLM contract unchanged** — `WorldMap.tsx` still resolves ownership via `properties.parent`, so the coarser data just renders coarser regions.
Part of #16 (the LLM sub-region-transfer piece is still pending).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #16
Coarsens the real sub-national regions so no region is smaller than ~100×100 km (10,000 km²), except islands — per the request to “join cities to the region around it.”
scripts/coarsen-regions.mjs(npm run coarsen:regions): merges small same-country regions into their nearest surrounding neighbor using real boolean dissolves (@turf/union), cascading smallest-first to a fixed point. Regions with no same-country neighbor (islands) are left alone.public/regions.geo.json: 4,138 → 1,796 regions (2,342 merged). Over-granular countries collapse to a few-to-tens: UK 232→16, Italy 107→19, France 110→42, Russia 200→80; median is now 7/country. Standalone cities are absorbed (Paris → Val-de-Marne cascade, London districts, DC → Maryland). 83 island regions are exempted from the floor.@turf/unionadded as a devDependency (used only by the generator script, not the app bundle).scripts/regions.test.ts+1 test (non-island regions below the floor < 1% of the dataset).WorldMap.tsxstill resolves ownership viaproperties.parent, so the coarser data just renders coarser regions.Part of #16 (the LLM sub-region-transfer piece is still pending).