Skip to content

Fix overlapping county borders in well-density-by-county#113

Merged
jirhiker merged 1 commit into
mainfrom
fix/county-polygon-resolution
Jul 8, 2026
Merged

Fix overlapping county borders in well-density-by-county#113
jirhiker merged 1 commit into
mainfrom
fix/county-polygon-resolution

Conversation

@jirhiker

@jirhiker jirhiker commented Jul 8, 2026

Copy link
Copy Markdown
Member

Problem

County polygons in the well-density-by-county view had overlapping (and gapping) borders between adjacent counties.

Root cause

_make_shape in backend/bounding_polygons.py applied poly.simplify(0.1) (~11 km tolerance) to each county polygon independently. Adjacent counties share exact boundary vertices in the geoconnex source data, so simplifying each separately moved those shared vertices in different directions — neighboring borders no longer coincided.

Fix

Drop the simplification; use the full-resolution source geometry. Shared borders stay coincident, so counties tile cleanly.

Verification

  • All 33 NM county pairs now have zero pairwise overlap (previously several overlapped, e.g. Chaves–Eddy ~5 units²).
  • Full-resolution WKT stays compact (~1 KB per county), so spatial-filter query size is unaffected.
  • No tests or callers depended on the simplified output (config uses .bounds/truthiness; the /county_bounds worker endpoint just serves the polygon).

🤖 Generated with Claude Code

_make_shape applied poly.simplify(0.1) (~11 km tolerance) to each county
polygon independently. Adjacent counties share exact boundary vertices in the
geoconnex source data, so simplifying each one separately moved those shared
vertices in different directions, making neighboring county borders overlap
(and gap). This showed up as artifacts in the well-density-by-county view.

Drop the simplification and use the full-resolution source geometry. Shared
borders stay coincident, so counties tile cleanly.

Verified: all 33 NM county pairs now have zero pairwise overlap (previously
several overlapped, e.g. Chaves-Eddy). Full-resolution WKT remains compact
(~1 KB per county), so spatial-filter query size is unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Your pull request is automatically being deployed to Dagster Cloud.

Location Status Link Updated
die-orchestration View in Cloud Jul 08, 2026 at 09:27 PM (UTC)

@jirhiker
jirhiker merged commit 58edabb into main Jul 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant