Radio Station Coverage - Next Steps¶
Completed (2025-12-26)¶
cbapp (v0.4.69)¶
- District-centric radio integration with districts.nominate.ai API
- Click congressional district -> "Radio Coverage" section in panel
- "Show Stations" button loads all contours for that district
- Amber contours with dashed borders (distinct from party colors)
- Station list in panel sorted by coverage percentage
- Radio legend bar with "Clear" button
- Full district data fetch (demographics, wiki) on panel open
- Debug logging for troubleshooting (can remove later)
cbdistricts (v0.1.0)¶
- Fixed cache decorator to properly handle JSONResponse objects
- Radio API endpoints working:
GET /api/v1/radio/stations- List stations with filteringGET /api/v1/radio/stations/geojson- Station points as GeoJSONGET /api/v1/radio/stations/{facility_id}/contour- Single station contourGET /api/v1/radio/districts/{geoid}/geojson- All contours for a district
Next Steps¶
1. Polish & Cleanup¶
- Remove debug console.log statements from maps/index.html
- Replace inline SVG icons with proper lucide icons (investigate why they weren't rendering)
- Remove
!importantinline styles once root cause is identified - Add loading spinner while contours are being fetched
2. UX Improvements¶
- Add hover tooltip on contours showing station callsign/frequency
- Click contour to highlight corresponding station in list
- Add "Zoom to Coverage" button to fit map to contour bounds
- Consider color-coding contours by format (News/Talk=blue, Country=brown, etc.)
3. Station Points Layer (Future)¶
- Add optional station markers layer (radio tower icons)
- Filter by state/format/AM/FM
- Click station marker to show single contour
- Cluster markers at low zoom levels
4. Data Enhancements¶
- Add station owner information to panel
- Add Nielsen DMA market info
- Show estimated audience reach
- Link to FCC facility page
5. Performance¶
- Cache contour GeoJSON in browser localStorage
- Consider simplifying contour polygons for faster rendering
- Lazy load contours as map pans (for station-centric view)
6. Testing¶
- Test with districts that have many stations (CA, TX)
- Test with districts that have few/no stations
- Mobile responsiveness of radio panel section
- Cross-browser testing (Chrome, Firefox, Safari)
API Reference¶
Get Radio Stations Covering a District¶
Response: GeoJSON FeatureCollection with Polygon contours
- facility_id - Station identifier
- callsign - e.g., "WNVR-AM"
- service_type - "am" or "fm"
- frequency - e.g., 1030.0
- power_kw - Transmitter power
- coverage_pct - Percentage of district covered
Example¶
curl https://districts.nominate.ai/api/v1/radio/districts/5501/geojson
# Returns 11 stations covering Wisconsin's 1st Congressional District
Files Modified¶
cbapp¶
src/app/templates/maps/index.html- Radio UI integration
cbdistricts¶
api/cache/decorators.py- JSONResponse serialization fixapi/routes/radio.py- Radio API endpoints (existing)