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,51 @@ demographics:
race_native: 1205
hispanic: 22587
bachelors_plus: 68941
districts:
- to: "us/states/sc/districts/01"
rel: in-district
area_weight: 0.9963
- to: "us/states/sc/districts/senate/37"
rel: in-district
area_weight: 0.5723
- to: "us/states/sc/districts/senate/32"
rel: in-district
area_weight: 0.2536
- to: "us/states/sc/districts/senate/39"
rel: in-district
area_weight: 0.1387
- to: "us/states/sc/districts/senate/44"
rel: in-district
area_weight: 0.0354
- to: "us/states/sc/districts/house/103"
rel: in-district
area_weight: 0.3106
- to: "us/states/sc/districts/house/102"
rel: in-district
area_weight: 0.3075
- to: "us/states/sc/districts/house/100"
rel: in-district
area_weight: 0.1625
- to: "us/states/sc/districts/house/101"
rel: in-district
area_weight: 0.1287
- to: "us/states/sc/districts/house/99"
rel: in-district
area_weight: 0.045
- to: "us/states/sc/districts/house/117"
rel: in-district
area_weight: 0.0276
- to: "us/states/sc/districts/house/92"
rel: in-district
area_weight: 0.0128
- to: "us/states/sc/districts/house/15"
rel: in-district
area_weight: 0.0051
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, sc]
timestamp: "2026-07-03"
@@ -56,6 +98,23 @@ County jurisdiction — 1 officeholders mapped.
| Hispanic/Latino | 22587 |
| Bachelor's or higher | 68941 |
## Districts
- [SC-01](/us/states/sc/districts/01.md) — 100% (congressional)
- [SC Senate District 37](/us/states/sc/districts/senate/37.md) — 57% (state senate)
- [SC Senate District 32](/us/states/sc/districts/senate/32.md) — 25% (state senate)
- [SC Senate District 39](/us/states/sc/districts/senate/39.md) — 14% (state senate)
- [SC Senate District 44](/us/states/sc/districts/senate/44.md) — 4% (state senate)
- [SC House District 103](/us/states/sc/districts/house/103.md) — 31% (state house)
- [SC House District 102](/us/states/sc/districts/house/102.md) — 31% (state house)
- [SC House District 100](/us/states/sc/districts/house/100.md) — 16% (state house)
- [SC House District 101](/us/states/sc/districts/house/101.md) — 13% (state house)
- [SC House District 99](/us/states/sc/districts/house/99.md) — 4% (state house)
- [SC House District 117](/us/states/sc/districts/house/117.md) — 3% (state house)
- [SC House District 92](/us/states/sc/districts/house/92.md) — 1% (state house)
- [SC House District 15](/us/states/sc/districts/house/15.md) — 1% (state house)
## Source
- demographics: Census ACS 2023
- districts: PostGIS area-intersection over Census TIGER 2024 boundaries