feat: add HIFLD transmission lines dataset#22
Conversation
- Add 52,244 US transmission line segments (69kV-765kV) from HIFLD - Sync script: scripts/sync-transmission-lines.ts (ArcGIS REST API with pagination) - Type definitions: types/transmission-lines.ts - Data loading hook: lib/transmission-lines.ts - Copy script: scripts/copy-transmission-lines.mjs - Tippecanoe prep: scripts/prepare-transmission-lines-geojson.mjs - PMTiles tile generation in build-tiles.sh - API tile route: app/api/tiles/transmission-lines/[z]/[x]/[y]/route.ts - Map layer in ExplorerMap.tsx (color by voltage class, zoom 3+) - List page: app/(shell)/transmission-lines/page.tsx - Navigation update in app/(shell)/layout.tsx - About page and homepage updates with stats - GitHub Actions workflow: .github/workflows/sync-transmission.yml
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3329d581c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // For GCS (lat/lon), it's in decimal degrees — 1 degree ≈ 69 miles. | ||
| // For projected (meters), divide by 1609.34. | ||
| // HIFLD data uses geographic coords (degrees), so multiply by 69. | ||
| return Math.round(shapeLen * 69 * 100) / 100; |
There was a problem hiding this comment.
Convert Shape__Length using correct units
The length conversion currently multiplies Shape__Length by 69 as if the source units are degrees, which makes derived mile values orders of magnitude too large for this dataset and propagates bad data into data/transmission-lines.json (affecting the Length column and length-based sorting). Please convert based on the actual spatial-reference units (e.g., meters-to-miles) rather than hard-coding a degrees conversion.
Useful? React with 👍 / 👎.
| result = result.filter((l) => l.voltageClass === voltageFilter); | ||
| } | ||
| if (statusFilter !== "all") { | ||
| result = result.filter((l) => l.status.toLowerCase().includes(statusFilter.toLowerCase())); |
There was a problem hiding this comment.
Match status filter exactly for in-service rows
Filtering with includes(statusFilter) causes false matches: selecting "In Service" also returns rows whose status is "Not In Service" because that string contains the same substring. When those statuses are both present, users cannot isolate truly in-service lines; use exact normalized comparisons (or explicit status buckets) instead of substring matching.
Useful? React with 👍 / 👎.
Summary
Adds US electric power transmission lines (69kV–765kV) from the HIFLD dataset to OpenGrid.
What's included
Data:
data/transmission-lines.json— 19MB metadata array for list/searchpublic/tiles/transmission-lines.pmtiles, 56MB)Files added/changed:
scripts/sync-transmission-lines.ts— ArcGIS REST API sync with paginationtypes/transmission-lines.ts— TypeScript interfaces + VoltageClass typelib/transmission-lines.ts— React hook + classification helpersscripts/copy-transmission-lines.mjs— prebuild copy to public/data/scripts/prepare-transmission-lines-geojson.mjs— tippecanoe prepscripts/build-tiles.sh— updated to generate transmission-lines.pmtilesapp/api/tiles/transmission-lines/[z]/[x]/[y]/route.ts— PMTiles tile servercomponents/explorer/ExplorerMap.tsx— new line layer colored by voltage classapp/(shell)/transmission-lines/page.tsx— list page with search + voltage filterapp/(shell)/layout.tsx— Transmission nav linkapp/(shell)/about/page.tsx+app/(shell)/page.tsx— stats updates.github/workflows/sync-transmission.yml— monthly sync scheduleMap layer:
Note: The
transmission-lines.pmtilesfile is 56MB (just over GitHub's 50MB recommendation) — it still works, but consider LFS if this becomes an issue.