How warner-wvez/ora works
Purpose and entry point
Ora is a static GitHub Pages map for public US traffic-camera feeds, plus NYC, Illinois, and a Chicago enforcement-analysis layer. The browser entry point is index.html; it loads prebuilt JSON directly, renders with MapLibre GL JS, and has no server-side application or build step. Core datasets include states/index.json, cameras.json, cameras-nyc.json, and cameras-chicago-enforcement.json.
Client map and layer orchestration
index.html owns map initialization, state/layer selection, lazy loading of selected state files, camera rendering, popups, search, URL-state restoration, saved local routes, and image/video playback behavior. It treats the data repository as a static API: states/index.json supplies available state metadata, then states/.json supplies camera features. Illinois, NYC, and Chicago are separate precomputed layers rather than state-index payloads:
• index.html
• states/index.json
• cameras.json
Camera-data ingestion pipeline
Python builders fetch heterogeneous DOT/vendor sources and normalize them into per-state JSON suitable for static consumption. Platform-specific builders encode source/API quirks, coordinate cleanup, media URL extraction, direction metadata, and whether a stream is viable in a static browser context. The shared older-511 ingestion path is build-states.py; newer GraphQL, MapLarge/Texas, and WSDOT each have dedicated paths:
• build-states.py
• build-states-graphql.py
• build-states-tx.py
Many states have dedicated extraction scripts because their public surfaces differ materially, such as ASP.NET, ArcGIS, proprietary endpoints, or site scraping:
• build-states-ms.py
• build-states-wa.py
• build-states-ri.py
Static data contract and media boundary
State outputs in states/*.json contain map-ready camera locations and their nested views, snapshots, and eligible HLS URLs; they are committed deployment artifacts. Some feeds are snapshot-only because streams are CORS-blocked, Referer-locked, DRM-protected, authenticated, or short-lived-token URLs. Video-capable records permit in-browser HLS playback; snapshot records remain cross-origin images and cannot be pixel-inspected by the client. Washington’s measured refresh metadata is folded from:
• states/WA.json
• states/WA-refresh.json
• measure-refresh-wa.py
Feed health pipeline
probe-health.py periodically probes snapshot availability and classifies views as offline, placeholder, or frozen using inexpensive ranged-image fingerprints plus persisted known placeholder signatures. Results are emitted per state beneath states/health/ and consumed by the client to present degraded cameras before selection. The scheduled workflow reruns this data-quality job every six hours and commits changes:
• probe-health.py
• .github/workflows/camera-health.yml
• states/health/known-placeholders.json
Chicago enforcement analytics
Chicago is a separate non-video analytical layer. build-chicago-enforcement.py fetches Chicago Data Portal violation, location, and crash data; aggregates ticket volumes; spatially joins injury crashes near cameras; then assigns a safety-versus-revenue quadrant. Its static result is consumed alongside traffic-camera layers:
• build-chicago-enforcement.py
• cameras-chicago-enforcement.json
• cameras-chicago-enforcement.json
Runtime and external infrastructure
The deployed runtime is a static browser page, suitable for GitHub Pages. Map rendering uses MapLibre GL JS loaded from CDN, with OpenFreeMap vector tiles and optional Esri World Imagery. Camera media and metadata remain hosted by state DOTs, vendor 511 platforms, NYC DOT, Illinois/Travel Midwest, and Chicago’s open data portal. Browser constraints—not a backend proxy—define the principal integration boundary: Ora only ships media URLs that remain usable from an unrelated static origin.
Main entry points: index.html Map application · probe-health.py Health probe · build-states.py Older 511 builder · build-states-graphql.py Modern source builders
Components 18
Static browser runtime
GitHub Pages client with no backend.
- Map application · Initializes the map and orchestrates layers, media, search, and saved routes.
index.html - MapLibre + tile basemaps · CDN map renderer with OpenFreeMap and optional Esri imagery.
Static data artifacts
Committed JSON is the client data contract.
- State catalog · Lists selectable state datasets.
states/index.json - Per-state camera data · Map-ready cameras, nested views, snapshots, and eligible HLS URLs.
- General camera layer
cameras.json - NYC camera layer · Separate precomputed city layer.
cameras-nyc.json - Chicago enforcement layer · Safety-versus-revenue camera classifications.
cameras-chicago-enforcement.json - Washington refresh metadata · Measured feed refresh metadata folded into Washington data.
states/WA-refresh.json
Data builders
Python ingestion and analytical pipelines.
- Older 511 builder · Shared normalization path for older 511 sources.
build-states.py - Modern source builders · Dedicated GraphQL, Texas MapLarge, and WSDOT ingestion paths.
build-states-graphql.py - Specialized state extractors · Handles materially different public source surfaces.
build-states-ms.py - WA refresh measurement
measure-refresh-wa.py - Chicago analytics builder · Aggregates violations and crash proximity into quadrants.
build-chicago-enforcement.py
Feed health
Scheduled feed-quality classification.
- Health probe · Classifies unavailable, placeholder, and frozen snapshots.
probe-health.py - Known placeholders
states/health/known-placeholders.json - Six-hour health workflow · Runs probes and commits refreshed health data.
.github/workflows/camera-health.yml
External sources
Public maps, feeds, and data providers.
- DOTs, vendors, and open data · State camera media, 511 metadata, and Chicago source data remain external.
- Browser media boundary · Only static-origin-compatible snapshots and HLS streams are usable.
Connections 22
- Map application → MapLibre + tile basemaps: renders map
- Map application → State catalog: loads catalog
- Map application → Per-state camera data: lazy-loads selected state
- Map application → General camera layer: loads layer
- Map application → NYC camera layer: loads layer
- Map application → Chicago enforcement layer: loads layer
- Map application → Browser media boundary: displays snapshots / HLS
- Older 511 builder → DOTs, vendors, and open data: fetches feeds
- Modern source builders → DOTs, vendors, and open data: fetches feeds
- Specialized state extractors → DOTs, vendors, and open data: scrapes source-specific feeds
- Older 511 builder → Per-state camera data: writes normalized states
- Modern source builders → Per-state camera data: writes normalized states
- Specialized state extractors → Per-state camera data: writes state outputs
- WA refresh measurement → Washington refresh metadata: measures refresh
- Washington refresh metadata → Per-state camera data: folded into WA data
- Chicago analytics builder → DOTs, vendors, and open data: fetches portal data
- Chicago analytics builder → Chicago enforcement layer: writes analysis
- Six-hour health workflow → Health probe: runs every 6 hours
- Health probe → DOTs, vendors, and open data: probes snapshots
- Known placeholders → Health probe: known signatures
- Health probe → Per-state camera data: assesses camera views
- Browser media boundary → DOTs, vendors, and open data: cross-origin requests