Graph: national county↔district↔legislator authority layer

The first edges in the repo. Every US county now links to the districts it
sits in, weighted by area overlap, and every legislator links to the district
they represent — county → district → representative, traversable.

Data (PostGIS, no Atlas dependency — computed directly from geometry):
- data/county_district_edges.jsonl — 16,328 weighted edges. area_weight =
  ST_Area(ST_Intersection(county, district))/ST_Area(county) over ST_MakeValid
  Census TIGER 2024 geometries, overlaps <0.5% dropped. Uses area-intersection,
  NOT centroid-in-polygon, so urban districts that carve through counties
  (e.g. GA CD-5 / Atlanta across Clayton+DeKalb+Fulton) are captured, not
  silently dropped. Per-county weights sum to ~1.0 per district type.

build.py:
- ~6,896 new district nodes: 435 CD (ACS demographics where available; sparse
  for the 8 states missing from acs_cd) + 4,927 state-house + 1,897 state-senate
  (geometry-only). GEOID/number-keyed, stable.
- county index.md gains a `districts:` block (frontmatter) + a ## Districts
  section (body links, so link-integrity checks them).
- legislators + US House members gain `represents:` pointing at their district
  node; edge stored once on the person, inverse left to the view.
- schemas/jurisdiction: classification enum + chamber/districts fields.

Honest gaps (logged, not hidden): ID + NH have no state-house geometry, so
their house districts get nodes (represents resolves) but no county edges;
CD nodes for acs_cd-missing states are demographically sparse.

Deterministic (byte-identical rebuild); validate.py passes 26,617 records,
link-integrity clean (every district/represents link resolves).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Fabio
2026-07-04 22:28:08 -04:00
parent 6c9990a115
commit 1beeaab2db
18213 changed files with 280514 additions and 3515 deletions
@@ -22,9 +22,15 @@ demographics:
race_native: 1025
hispanic: 8561
bachelors_plus: 129740
districts:
- to: "us/states/ma/districts/09"
rel: in-district
area_weight: 0.3491
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +62,11 @@ County jurisdiction.
| Hispanic/Latino | 8561 |
| Bachelor's or higher | 129740 |
## Districts
- [MA-09](/us/states/ma/districts/09.md) — 35% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,15 @@ demographics:
race_native: 565
hispanic: 7591
bachelors_plus: 56324
districts:
- to: "us/states/ma/districts/01"
rel: in-district
area_weight: 0.9997
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +62,11 @@ County jurisdiction.
| Hispanic/Latino | 7591 |
| Bachelor's or higher | 56324 |
## Districts
- [MA-01](/us/states/ma/districts/01.md) — 100% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,21 @@ demographics:
race_native: 1323
hispanic: 59389
bachelors_plus: 174153
districts:
- to: "us/states/ma/districts/04"
rel: in-district
area_weight: 0.545
- to: "us/states/ma/districts/09"
rel: in-district
area_weight: 0.2673
- to: "us/states/ma/districts/08"
rel: in-district
area_weight: 0.0425
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +68,13 @@ County jurisdiction — 3 officeholders mapped.
| Hispanic/Latino | 59389 |
| Bachelor's or higher | 174153 |
## Districts
- [MA-04](/us/states/ma/districts/04.md) — 55% (congressional)
- [MA-09](/us/states/ma/districts/09.md) — 27% (congressional)
- [MA-08](/us/states/ma/districts/08.md) — 4% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,15 @@ demographics:
race_native: 222
hispanic: 682
bachelors_plus: 12627
districts:
- to: "us/states/ma/districts/09"
rel: in-district
area_weight: 0.2533
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +62,11 @@ County jurisdiction.
| Hispanic/Latino | 682 |
| Bachelor's or higher | 12627 |
## Districts
- [MA-09](/us/states/ma/districts/09.md) — 25% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,18 @@ demographics:
race_native: 2429
hispanic: 195593
bachelors_plus: 348582
districts:
- to: "us/states/ma/districts/06"
rel: in-district
area_weight: 0.5662
- to: "us/states/ma/districts/03"
rel: in-district
area_weight: 0.0799
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +65,12 @@ County jurisdiction — 8 officeholders mapped.
| Hispanic/Latino | 195593 |
| Bachelor's or higher | 348582 |
## Districts
- [MA-06](/us/states/ma/districts/06.md) — 57% (congressional)
- [MA-03](/us/states/ma/districts/03.md) — 8% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,18 @@ demographics:
race_native: 82
hispanic: 3839
bachelors_plus: 32142
districts:
- to: "us/states/ma/districts/02"
rel: in-district
area_weight: 0.8723
- to: "us/states/ma/districts/01"
rel: in-district
area_weight: 0.1275
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +65,12 @@ County jurisdiction.
| Hispanic/Latino | 3839 |
| Bachelor's or higher | 32142 |
## Districts
- [MA-02](/us/states/ma/districts/02.md) — 87% (congressional)
- [MA-01](/us/states/ma/districts/01.md) — 13% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,15 @@ demographics:
race_native: 1292
hispanic: 125188
bachelors_plus: 132778
districts:
- to: "us/states/ma/districts/01"
rel: in-district
area_weight: 0.9996
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +62,11 @@ County jurisdiction — 2 officeholders mapped.
| Hispanic/Latino | 125188 |
| Bachelor's or higher | 132778 |
## Districts
- [MA-01](/us/states/ma/districts/01.md) — 100% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,18 @@ demographics:
race_native: 333
hispanic: 11964
bachelors_plus: 79914
districts:
- to: "us/states/ma/districts/01"
rel: in-district
area_weight: 0.569
- to: "us/states/ma/districts/02"
rel: in-district
area_weight: 0.431
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +65,12 @@ County jurisdiction — 1 officeholders mapped.
| Hispanic/Latino | 11964 |
| Bachelor's or higher | 79914 |
## Districts
- [MA-01](/us/states/ma/districts/01.md) — 57% (congressional)
- [MA-02](/us/states/ma/districts/02.md) — 43% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,30 @@ demographics:
race_native: 3246
hispanic: 151761
bachelors_plus: 1044737
districts:
- to: "us/states/ma/districts/03"
rel: in-district
area_weight: 0.4993
- to: "us/states/ma/districts/05"
rel: in-district
area_weight: 0.2518
- to: "us/states/ma/districts/06"
rel: in-district
area_weight: 0.1237
- to: "us/states/ma/districts/02"
rel: in-district
area_weight: 0.0708
- to: "us/states/ma/districts/04"
rel: in-district
area_weight: 0.0406
- to: "us/states/ma/districts/07"
rel: in-district
area_weight: 0.0137
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +77,16 @@ County jurisdiction — 7 officeholders mapped.
| Hispanic/Latino | 151761 |
| Bachelor's or higher | 1044737 |
## Districts
- [MA-03](/us/states/ma/districts/03.md) — 50% (congressional)
- [MA-05](/us/states/ma/districts/05.md) — 25% (congressional)
- [MA-06](/us/states/ma/districts/06.md) — 12% (congressional)
- [MA-02](/us/states/ma/districts/02.md) — 7% (congressional)
- [MA-04](/us/states/ma/districts/04.md) — 4% (congressional)
- [MA-07](/us/states/ma/districts/07.md) — 1% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,15 @@ demographics:
race_native: 8
hispanic: 2467
bachelors_plus: 8240
districts:
- to: "us/states/ma/districts/09"
rel: in-district
area_weight: 0.1959
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +62,11 @@ County jurisdiction.
| Hispanic/Latino | 2467 |
| Bachelor's or higher | 8240 |
## Districts
- [MA-09](/us/states/ma/districts/09.md) — 20% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,30 @@ demographics:
race_native: 706
hispanic: 42383
bachelors_plus: 451470
districts:
- to: "us/states/ma/districts/04"
rel: in-district
area_weight: 0.463
- to: "us/states/ma/districts/08"
rel: in-district
area_weight: 0.3729
- to: "us/states/ma/districts/07"
rel: in-district
area_weight: 0.0393
- to: "us/states/ma/districts/02"
rel: in-district
area_weight: 0.026
- to: "us/states/ma/districts/09"
rel: in-district
area_weight: 0.0234
- to: "us/states/ma/districts/05"
rel: in-district
area_weight: 0.0169
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +77,16 @@ County jurisdiction — 2 officeholders mapped.
| Hispanic/Latino | 42383 |
| Bachelor's or higher | 451470 |
## Districts
- [MA-04](/us/states/ma/districts/04.md) — 46% (congressional)
- [MA-08](/us/states/ma/districts/08.md) — 37% (congressional)
- [MA-07](/us/states/ma/districts/07.md) — 4% (congressional)
- [MA-02](/us/states/ma/districts/02.md) — 3% (congressional)
- [MA-09](/us/states/ma/districts/09.md) — 2% (congressional)
- [MA-05](/us/states/ma/districts/05.md) — 2% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,21 @@ demographics:
race_native: 801
hispanic: 26184
bachelors_plus: 220404
districts:
- to: "us/states/ma/districts/09"
rel: in-district
area_weight: 0.5137
- to: "us/states/ma/districts/08"
rel: in-district
area_weight: 0.0966
- to: "us/states/ma/districts/04"
rel: in-district
area_weight: 0.0332
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +68,13 @@ County jurisdiction — 1 officeholders mapped.
| Hispanic/Latino | 26184 |
| Bachelor's or higher | 220404 |
## Districts
- [MA-09](/us/states/ma/districts/09.md) — 51% (congressional)
- [MA-08](/us/states/ma/districts/08.md) — 10% (congressional)
- [MA-04](/us/states/ma/districts/04.md) — 3% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,21 @@ demographics:
race_native: 2825
hispanic: 182283
bachelors_plus: 409219
districts:
- to: "us/states/ma/districts/07"
rel: in-district
area_weight: 0.3081
- to: "us/states/ma/districts/08"
rel: in-district
area_weight: 0.1782
- to: "us/states/ma/districts/05"
rel: in-district
area_weight: 0.0832
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +68,13 @@ County jurisdiction — 2 officeholders mapped.
| Hispanic/Latino | 182283 |
| Bachelor's or higher | 409219 |
## Districts
- [MA-07](/us/states/ma/districts/07.md) — 31% (congressional)
- [MA-08](/us/states/ma/districts/08.md) — 18% (congressional)
- [MA-05](/us/states/ma/districts/05.md) — 8% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries
@@ -22,9 +22,24 @@ demographics:
race_native: 2170
hispanic: 118968
bachelors_plus: 343880
districts:
- to: "us/states/ma/districts/02"
rel: in-district
area_weight: 0.587
- to: "us/states/ma/districts/01"
rel: in-district
area_weight: 0.1949
- to: "us/states/ma/districts/03"
rel: in-district
area_weight: 0.1838
- to: "us/states/ma/districts/04"
rel: in-district
area_weight: 0.0342
sources:
- field: demographics
source: Census ACS 2023
source: "Census ACS 2023"
- field: districts
source: "PostGIS area-intersection over Census TIGER 2024 boundaries"
confidence: official
tags: [jurisdiction, county, ma]
timestamp: "2026-07-03"
@@ -56,6 +71,14 @@ County jurisdiction — 1 officeholders mapped.
| Hispanic/Latino | 118968 |
| Bachelor's or higher | 343880 |
## Districts
- [MA-02](/us/states/ma/districts/02.md) — 59% (congressional)
- [MA-01](/us/states/ma/districts/01.md) — 19% (congressional)
- [MA-03](/us/states/ma/districts/03.md) — 18% (congressional)
- [MA-04](/us/states/ma/districts/04.md) — 3% (congressional)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries