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,96 @@ demographics:
race_native: 7827
hispanic: 108265
bachelors_plus: 409445
districts:
- to: "us/states/or/districts/03"
rel: in-district
area_weight: 0.7532
- to: "us/states/or/districts/01"
rel: in-district
area_weight: 0.2212
- to: "us/states/or/districts/05"
rel: in-district
area_weight: 0.0253
- to: "us/states/or/districts/senate/26"
rel: in-district
area_weight: 0.4434
- to: "us/states/or/districts/senate/16"
rel: in-district
area_weight: 0.1198
- to: "us/states/or/districts/senate/22"
rel: in-district
area_weight: 0.1085
- to: "us/states/or/districts/senate/25"
rel: in-district
area_weight: 0.0877
- to: "us/states/or/districts/senate/17"
rel: in-district
area_weight: 0.0667
- to: "us/states/or/districts/senate/23"
rel: in-district
area_weight: 0.0514
- to: "us/states/or/districts/senate/24"
rel: in-district
area_weight: 0.0469
- to: "us/states/or/districts/senate/21"
rel: in-district
area_weight: 0.0297
- to: "us/states/or/districts/senate/14"
rel: in-district
area_weight: 0.0252
- to: "us/states/or/districts/senate/19"
rel: in-district
area_weight: 0.0205
- to: "us/states/or/districts/house/52"
rel: in-district
area_weight: 0.4434
- to: "us/states/or/districts/house/31"
rel: in-district
area_weight: 0.1198
- to: "us/states/or/districts/house/44"
rel: in-district
area_weight: 0.0911
- to: "us/states/or/districts/house/33"
rel: in-district
area_weight: 0.0654
- to: "us/states/or/districts/house/49"
rel: in-district
area_weight: 0.0541
- to: "us/states/or/districts/house/50"
rel: in-district
area_weight: 0.0337
- to: "us/states/or/districts/house/45"
rel: in-district
area_weight: 0.0305
- to: "us/states/or/districts/house/28"
rel: in-district
area_weight: 0.0252
- to: "us/states/or/districts/house/48"
rel: in-district
area_weight: 0.0252
- to: "us/states/or/districts/house/47"
rel: in-district
area_weight: 0.0217
- to: "us/states/or/districts/house/46"
rel: in-district
area_weight: 0.0209
- to: "us/states/or/districts/house/38"
rel: in-district
area_weight: 0.0205
- to: "us/states/or/districts/house/43"
rel: in-district
area_weight: 0.0174
- to: "us/states/or/districts/house/42"
rel: in-district
area_weight: 0.0168
- to: "us/states/or/districts/house/41"
rel: in-district
area_weight: 0.0129
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, or]
timestamp: "2026-07-03"
@@ -56,6 +143,38 @@ County jurisdiction — 3 officeholders mapped.
| Hispanic/Latino | 108265 |
| Bachelor's or higher | 409445 |
## Districts
- [OR-03](/us/states/or/districts/03.md) — 75% (congressional)
- [OR-01](/us/states/or/districts/01.md) — 22% (congressional)
- [OR-05](/us/states/or/districts/05.md) — 3% (congressional)
- [OR Senate District 26](/us/states/or/districts/senate/26.md) — 44% (state senate)
- [OR Senate District 16](/us/states/or/districts/senate/16.md) — 12% (state senate)
- [OR Senate District 22](/us/states/or/districts/senate/22.md) — 11% (state senate)
- [OR Senate District 25](/us/states/or/districts/senate/25.md) — 9% (state senate)
- [OR Senate District 17](/us/states/or/districts/senate/17.md) — 7% (state senate)
- [OR Senate District 23](/us/states/or/districts/senate/23.md) — 5% (state senate)
- [OR Senate District 24](/us/states/or/districts/senate/24.md) — 5% (state senate)
- [OR Senate District 21](/us/states/or/districts/senate/21.md) — 3% (state senate)
- [OR Senate District 14](/us/states/or/districts/senate/14.md) — 3% (state senate)
- [OR Senate District 19](/us/states/or/districts/senate/19.md) — 2% (state senate)
- [OR House District 52](/us/states/or/districts/house/52.md) — 44% (state house)
- [OR House District 31](/us/states/or/districts/house/31.md) — 12% (state house)
- [OR House District 44](/us/states/or/districts/house/44.md) — 9% (state house)
- [OR House District 33](/us/states/or/districts/house/33.md) — 7% (state house)
- [OR House District 49](/us/states/or/districts/house/49.md) — 5% (state house)
- [OR House District 50](/us/states/or/districts/house/50.md) — 3% (state house)
- [OR House District 45](/us/states/or/districts/house/45.md) — 3% (state house)
- [OR House District 28](/us/states/or/districts/house/28.md) — 3% (state house)
- [OR House District 48](/us/states/or/districts/house/48.md) — 3% (state house)
- [OR House District 47](/us/states/or/districts/house/47.md) — 2% (state house)
- [OR House District 46](/us/states/or/districts/house/46.md) — 2% (state house)
- [OR House District 38](/us/states/or/districts/house/38.md) — 2% (state house)
- [OR House District 43](/us/states/or/districts/house/43.md) — 2% (state house)
- [OR House District 42](/us/states/or/districts/house/42.md) — 2% (state house)
- [OR House District 41](/us/states/or/districts/house/41.md) — 1% (state house)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries