Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

Merge branch 'main' into feat/wsdot-camera-pack

Sameh Khamis52d26b057723
diff --cc .env.example
index bec981341,c021ec9e9..4dacceaa5
--- a/.env.example
+++ b/.env.example
@@@ -219,8 -219,8 +219,10 @@@ AISSTREAM_API_KEY
# CCTV_CALGARY_ENABLED=1 # set 0 to disable the Open Calgary (Alberta) cameras
# CCTV_CALGARY_MAX_SOURCES=220 # cap cameras loaded from the Open Calgary catalog
# CCTV_CALGARY_ROWS_URL= # override the Open Calgary catalog URL
+ # CCTV_KINGCOUNTY_ENABLED=1 # set 0 to disable the King County (Washington) road cameras
+ # CCTV_KINGCOUNTY_MAX_SOURCES=125 # cap cameras loaded from the King County catalog
+# CCTV_WSDOT_ENABLED=1 # set 0 to disable the WSDOT (Washington State) highway cameras
+# CCTV_WSDOT_MAX_SOURCES=250 # cap cameras loaded from the WSDOT catalog, nearest Seattle/Spokane first; min 8, max 1200
# CCTV_VEGVESEN_ENABLED=1 # set 0 to disable the Statens vegvesen (Norway) road cameras
# CCTV_VEGVESEN_MAX_SOURCES=900 # cap cameras loaded from Statens vegvesen (default loads all ~850 live; max 1000)
# CCTV_VEGVESEN_VIDEO=1 # set 0 to show stills instead of live HLS for Statens vegvesen video cameras
diff --cc CHANGELOG.md
index 13d5633d6,781ba34d8..0e1d54537
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -1,15 -1,28 +1,38 @@@
# Changelog
+- Add WSDOT highway cameras (Washington State) as a keyless CCTV source pack:
+ WSDOT's official Travel Center camera layer, with frames registered only on
+ WSDOT's own image host (partner-hosted cameras such as Oregon DOT and City of
+ Seattle are skipped). Cameras with a single cardinal `CompassDirection` get
+ a high-confidence heading; `B` (both directions), `O`, and unset directions
+ use the shared id-hash fallback at low confidence. By default the 250
+ cameras nearest Seattle and Spokane load; `CCTV_WSDOT_MAX_SOURCES` sets the
+ cap (8–1,200) and `CCTV_WSDOT_ENABLED=0` turns the pack off (bassem chagra,
+ #644).
+
+ - Add King County road cameras (Washington State) as a keyless CCTV source
+ pack: one public King County DOT ArcGIS layer, fetched with an explicit field
+ list so its staff-name columns are never requested, and frames pinned to the
+ county's own image host and upgraded to HTTPS. WSDOT-owned rows are skipped,
+ and city-owned cameras the county hosts credit their owner. The layer
+ publishes no facing, so headings use the shared id-hash fallback at low
+ confidence. It does publish each camera's hardware, which is served on
+ `/api/cctv/sources` as `model` and `manufacturer`. `CCTV_KINGCOUNTY_MAX_SOURCES`
+ sets the cap and `CCTV_KINGCOUNTY_ENABLED=0` turns the pack off
+ (bassem chagra, #645).
+
+ - Add City of Toronto RESCU traffic cameras as a keyless CCTV source pack: the
+ ~336 municipal cameras the Ontario 511 pack does not carry — downtown
+ arterials plus the Gardiner, DVP, Allen and Lake Shore. The list is the
+ City's own open data feed; frames are built from the documented
+ `loc####.jpg` convention and a digits-only camera number, so the frame proxy
+ is pinned to the portal origin by construction. The dataset publishes no
+ camera facing — its `D1`-`D4` fields describe static 2016 comparison images,
+ not the live pan-tilt-zoom frame — so headings use the shared id-hash
+ fallback at low confidence and are corrected with the calibration gizmo.
+ Carries the required Open Government Licence – Toronto attribution. Disable
+ with `CCTV_TORONTO_ENABLED=0`.
+
- Stop one retired bikeshare feed from reporting the whole layer as failed.
City feeds are fetched independently, but failure was recorded in a single
flag that only a successful *activation* cleared — and an already-loaded city
diff --cc DATA_SOURCES.md
index 4ce25a4e0,8794662bd..cb1fe72b0
--- a/DATA_SOURCES.md
+++ b/DATA_SOURCES.md
@@@ -59,9 -59,10 +59,11 @@@ How to read this
| **Fintraffic / Digitraffic (weathercams)** | CCTV camera catalog + frames, Finland | [CC BY 4.0](https://www.digitraffic.fi/en/terms-of-service/) — attribution REQUIRED | "Fintraffic / digitraffic.fi, license CC BY 4.0" |
| **DriveBC** (Government of British Columbia) | CCTV camera catalog + frames, British Columbia highways | [Open Government Licence – British Columbia](https://www2.gov.bc.ca/gov/content/data/open-data/open-government-licence-bc) — attribution REQUIRED | "DriveBC. Contains information licensed under the Open Government Licence – British Columbia" |
| **Open Calgary** (`data.calgary.ca`) | CCTV camera catalog + frames, Calgary | [Open Government Licence – City of Calgary](https://data.calgary.ca/stories/s/Open-Calgary-Terms-of-Use/u45n-7awa) — attribution REQUIRED | "Contains information licensed under the Open Government Licence – City of Calgary" |
+ | **King County Road Services** (`services.arcgis.com`, King County GIS) | CCTV camera catalog + frames, unincorporated King County WA road network | [KCGIS Center terms](https://kingcounty.gov/en/dept/kcit/data-information-services/gis-center/about/terms-conditions-copyrights) — attribution required; public ArcGIS layer | "King County Road Services" (partner-city cameras name their owner) |
+| **WSDOT** (`data.wsdot.wa.gov`) | CCTV camera catalog + frames, Washington State highways | [WSDOT travel information disclaimer](https://wsdot.wa.gov/about/policies/travel-information-disclaimer) — public "low volume" feed; catalog cached, frames on WSDOT's own image host only | "Washington State Department of Transportation (Travel Center)" (courtesy) |
| **Statens vegvesen** (catalog `ogckart-sn1.atlas.vegvesen.no`, frames `kamera.atlas.vegvesen.no`, HLS `kamera.vegvesen.no`) | CCTV camera catalog + frames + live HLS video, Norway road cameras | [NLOD 2.0](https://data.norge.no/nlod/en/2.0) — attribution REQUIRED | "Contains data under the Norwegian licence for Open Government data (NLOD) distributed by Statens vegvesen" |
| **NYC DOT Traffic Management Center** (`webcams.nyctmc.org`) | CCTV camera catalog + frames, New York City five boroughs | NYC DOT requires developers to sign a [data-sharing agreement](https://www.nyc.gov/html/dot/html/about/datafeeds.shtml) for the camera feed. **Off by default**; enable only under your own agreement | "NYC DOT Traffic Management Center" + NYC DOT's required application disclaimer (in the Data attribution popover) |
+ | **City of Toronto Open Data** (`opendata.toronto.ca`) | CCTV camera catalog + frames, Toronto city streets | [Open Government Licence – Toronto](https://www.toronto.ca/city-government/data-research-maps/open-data/open-data-licence/) — attribution REQUIRED | "Contains information licensed under the Open Government Licence – Toronto" |
| **GBFS (Lyft / BCycle / Social Bicycles / PBSC)** | Bikeshare availability | Per-feed (attribution-only) | Credit the operator (e.g. Austin BCycle) + its `license_url` |
| **Bike Share Toronto** (`toronto.publicbikesystem.net`) | Bikeshare station availability, Toronto | Operator GBFS feed. No licence is published: the City's open-data package declares none and the feed has no `license_url`. Attribution is given to the operator. | "Bike Share Toronto (Toronto Parking Authority)" |
| **Oslo / Bergen / Trondheim Bysykkel** (Urban Sharing, `gbfs.urbansharing.com`) | Bikeshare availability, Oslo, Bergen and Trondheim city bikes. Keyless GBFS; the proxy sends the `Client-Identifier` header the operators ask for | [NLOD 2.0](https://data.norge.no/nlod/en/2.0) — attribution REQUIRED ([Oslo](https://oslobysykkel.no/en/open-data/realtime), [Bergen](https://bergenbysykkel.no/en/apne-data/sanntid), [Trondheim](https://trondheimbysykkel.no/en/open-data/realtime)) | "Contains data under the Norwegian licence for Open Government data (NLOD) made available by Oslo Bysykkel, Bergen Bysykkel and Trondheim Bysykkel" |
@@@ -143,9 -144,10 +145,11 @@@ The optional Local ADS-B layer and the
- **Warendorf webcam.** The Stadt Warendorf Marktplatz webcam, registered from the curated `config/cctv_sources.warendorf.json` (the Kreis Warendorf registration-office cameras from the contributing PR are indoor waiting rooms and were left out); only the municipal image host is proxied, frames are fetched at request time and never stored or redistributed. Disable with `CCTV_WARENDORF_ENABLED=0`.
- **Live Traffic NSW cameras.** The camera list is the keyless public `data.livetraffic.com/cameras/traffic-cam.json` feed (Transport for NSW open data, CC BY 4.0); frames are stills on `webcams.transport.nsw.gov.au`, and only that host is registered. That image host answers non-browser clients with an HTML placeholder, so the proxy identifies as a browser for that one host and as itself everywhere else. Frames are fetched at request time and never stored or redistributed. Disable with `CCTV_NSW_ENABLED=0`.
- **Open Calgary traffic cameras.** Keyless. The camera list is the public Socrata dataset `k7p9-kppz` on `data.calgary.ca`; frames are stills on the city's own `trafficcam.calgary.ca` host, and only that host is registered. Most rows publish an `http://` frame URL and the host redirects those to HTTPS, so URLs are upgraded and pinned to that origin before registration. Frames are fetched at request time and never stored or redistributed. The dataset publishes no camera facing: the `quadrant` field and the quadrant suffix on each camera name are Calgary's address grid, not a bearing, so headings use the shared id-hash fallback at low confidence and are corrected with the in-app calibration gizmo. The licence requires the attribution statement above. Disable with `CCTV_CALGARY_ENABLED=0`.
+ - **King County road cameras.** Keyless. The camera list is one public ArcGIS FeatureServer GeoJSON query (King County DOT Road Services, "King County and WSDOT Traffic Cameras"). The `outFields` list is explicit on purpose: the layer also carries asset-administration columns — including staff names — that are never fetched. Only live, active cameras with frames on the county's own `info.kingcounty.gov` image handler are registered (the feed writes `http://`; the handler serves HTTPS, so URLs are upgraded and pinned before registration). WSDOT-owned rows in the layer are skipped because their frames are WSDOT-hosted, outside the pinned image origin; partner-city cameras hosted on the county image handler (e.g. Newcastle) name their owner as the per-camera credit. The layer publishes no facing, so headings use the shared id-hash fallback at low confidence. Uniquely, the county publishes each camera's hardware `Manufacturer`/`Model` (Cohu 3950/3965, Bosch AUTODOME, Axis PTZ domes); both are carried on the source (and served by `/api/cctv/sources`) as `model` and `manufacturer` for identified-hardware consumers (vendor-generic strings such as `PTZ` name no model and are omitted). Frames are fetched at request time and never stored or redistributed. Disable with `CCTV_KINGCOUNTY_ENABLED=0`.
+- **WSDOT highway cameras.** Keyless. The camera list is the Esri JSON layer `data.wsdot.wa.gov/travelcenter/Cameras.json` — the same layer WSDOT's own Travel Center map consumes (~1,700 point features, EPSG:3857 geometry converted to WGS84 on load; the body carries Windows-1252 bytes and is decoded as such). Only frames on WSDOT's own `images.wsdot.wa.gov` host are registered — the catalog also lists ~70 partner cameras (Oregon DOT, City of Seattle, lodges, airports) whose own terms apply, and those are skipped rather than proxied. WSDOT's layer metadata marks the feed for "low volume" use (see WSDOT's [travel information disclaimer](https://wsdot.wa.gov/about/policies/travel-information-disclaimer)). The catalog is fetched once per CCTV catalog refresh (every 15 minutes), and a camera's frame is fetched only when that camera is viewed; frames are never stored or redistributed. The live feed's `CompassDirection` is a single cardinal (N/E/S/W), `B` (both directions — most rows), `O`, or null. A single cardinal gives a high-confidence heading (the diagonals NE/SE/SW/NW are mapped too should they appear); `B`, `O`, null, and any other code carry no single facing and use the shared id-hash fallback at low confidence. By default the 250 cameras nearest Seattle and Spokane load; `CCTV_WSDOT_MAX_SOURCES` changes the cap (8–1,200) and `CCTV_WSDOT_ENABLED=0` turns the pack off. A keyed WSDOT Traveler Information API serves the same population for higher-volume use and is deliberately not required here.
- **Statens vegvesen road cameras.** Keyless. The camera list is one GeoJSON request to the OGC API Features view of the official DATEX 3.1 CCTV site table (`ogckart-sn1.atlas.vegvesen.no/ogc/features/v1/collections/datex_3_1:CctvSimple/items`), so no DATEX account is needed; frames are stills on `kamera.atlas.vegvesen.no/api/images/<cameraId>`, and only that exact path per camera is registered. Cameras the feed reports as faulty are dropped. About 135 working cameras also publish live HLS (`kamera.vegvesen.no/public/<cameraId>/manifest.m3u8`, MPEG-TS); those play as live video through the bounded in-memory HLS relay, with the still as the snapshot fallback, and only that exact manifest path per camera is registered. `CCTV_VEGVESEN_VIDEO=0` keeps every camera on stills. `orientationDescription` names the place a camera faces, not a bearing, so it goes into the label and headings use the id-hash fallback at low confidence. By default every live camera loads (~850); `CCTV_VEGVESEN_MAX_SOURCES` (8–1000) lowers the cap, keeping the cameras nearest Oslo, Bergen, Stavanger, Trondheim, Kristiansand, Bodø and Tromsø and `CCTV_VEGVESEN_ENABLED=0` turns the pack off. Frames are fetched at request time and never stored or redistributed. The NLOD attribution is registered in the Data attribution popover.
- **NYC DOT Traffic Management Center cameras.** Off by default. NYC DOT's [developer data feeds page](https://www.nyc.gov/html/dot/html/about/datafeeds.shtml) asks developers who want the camera feed to contact `[email protected]` and sign a data-sharing agreement. This project does not hold one that covers downstream installations, so the pack loads only when an operator who holds their own agreement sets `CCTV_NYC_ENABLED=1`; with the flag unset, empty or any other value, the server makes no request to NYC DOT. The endpoint needs no key. The camera list is the public `webcams.nyctmc.org/api/cameras` catalog (~980 cameras across the five boroughs); frames are stills at `webcams.nyctmc.org/api/cameras/<uuid>/image`, synthesized from a validated UUID rather than taken from the payload, and only that host is registered. Cameras the feed reports as offline are dropped. The catalog publishes no camera facing, so headings use the shared id-hash fallback at low confidence and are corrected with the in-app calibration gizmo. Once enabled, the 250 cameras nearest the borough cores load; `CCTV_NYC_MAX_SOURCES` (8–400) changes the cap. Frames are fetched at request time and never stored or redistributed. NYC DOT asks every application that uses its data to carry its disclaimer; it is registered verbatim in the Data attribution popover.
+ - **City of Toronto RESCU cameras.** Keyless. The camera list is the City's public `tmcearthcameras.json` on `opendata.toronto.ca` (dataset "Traffic Cameras", Transportation Services), served as JSONP and unwrapped with an anchored pattern. This is the municipal network the Ontario 511 pack does not carry: downtown arterials plus the Gardiner, DVP, Allen and Lake Shore. The list publishes no frame URL, so frame URLs are BUILT from the documented `CameraImages/loc####.jpg` convention and a strictly-digits camera number, pinning the frame proxy to the portal origin by construction; the list fetch refuses redirects and bounds the body it buffers. Frames are fetched at request time and never stored or redistributed. The dataset publishes no camera facing: the `D1`-`D4` fields are the directions of the *comparison* images (static reference stills captured in 2016 under a different path), not a bearing for the live pan-tilt-zoom frame, so headings use the shared id-hash fallback at low confidence and are corrected with the in-app calibration gizmo. A camera that is temporarily out of service still answers 200 with a byte-identical "Image Unavailable" placeholder rather than an error (about 6% of the network at any moment), so such a camera reads as healthy; the frame it shows is the agency's, not a synthesized one. The licence requires the attribution statement above. Disable with `CCTV_TORONTO_ENABLED=0`.
- **Camera frame content.** Public camera frames can contain people, vehicles and license plates, and the camera layer does nothing with them beyond putting them on the map. A successful upstream response is relayed as the provider served it: nothing in the camera pipeline blurs, redacts, enhances or restores it, and nothing there runs face, plate or object detection or otherwise recognises or classifies what is in the picture. (The ALPR layer described below maps where plate-reader cameras are, from locations contributors tagged in OpenStreetMap; it reads nothing from any camera frame.) When an upstream has no frame for a camera, what you see instead is a Google Street View still or the app's own placeholder card; the panel's source badge names which of them you are looking at, and a refresh that fails after a frame has arrived leaves the last good picture on screen rather than replacing it. The browser resamples each frame for display: onto a fixed 1920x1080 surface for the camera's projection plane in the scene, and onto a 192x108 canvas for the small ambient card. That scaling is the only change made to the picture, and the only pixels the camera layer reads back are a 64x36 downscale hashed to tell whether the picture has changed. Live streams are piped through; the still path reads the image into memory to pass it on — TxDOT wraps its JPEG in a JSON envelope, which is decoded there — and no frame is written to disk (the disk cache, `.gev-cache/`, holds feed JSON for other layers and never camera imagery). Outside that pipeline, the voice assistant is the one feature that sends imagery anywhere: when it answers a question about what is in view it may attach a downscaled screenshot of the rendered scene — including any camera plane on screen — to the request it sends to the voice model. Frames are fetched only from server-registered camera URLs — a client cannot hand the proxy a URL (see [SECURITY.md](SECURITY.md)). What the app does stays inside the line README draws: no named-person search, no face recognition, no tracking individuals.
- **Transit (GTFS-Realtime).** The proxy requests only registered operator feeds, validates redirects, bounds responses, and uses conditional requests, short snapshot caching and failure backoff. All seven registered regions are live-enabled; each can be disabled independently. Vehicles use delayed playback between reports, with report age and waiting states shown separately. Session-local selected trails are available for every feed. MBTA additionally retains up to 15 minutes of recently observed positions in the running proxy, so available history can survive a browser reload; server restart clears it. History reads never fetch upstream, and other feeds have no proxy retention. Nothing is archived to disk or collected in the background. Operator text credits are included as a courtesy and do not imply endorsement. Heights are aligned to work with Google 3D tiles; subway markers are shown at street level because these feeds do not supply depth.
- **Radio Browser.** `/api/radio/stations` discovers official API mirrors, makes bounded and coalesced healthy/geolocated HTTPS-station queries, caches the normalized public-domain directory for 45 minutes, and may serve the last good catalog for up to seven days during an outage. Refreshes must meet minimum accepted-query and station coverage before replacing a warm catalog; schema-valid responses whose rows all fail the product's health policy do not count as successful queries. A usable partial cold catalog is explicitly `DEGRADED`, and malformed or empty successful payloads are rejected atomically. Every directory and click-count request rejects redirects, validates all resolved addresses as globally routable (including reserved/documentation IPv4 and special/non-global IPv6 exclusions), and pins the TLS connection to a validated address. Only MP3/AAC non-HLS directory rows with public HTTPS stream targets are returned; favicons are intentionally omitted. Pressing play connects one browser audio element directly to the selected broadcaster and calls the directory's click counter through known-ID-only `POST /api/radio/click/:uuid`. GEV never proxies, caches, records, bundles, or redistributes audio. Radio Browser supplies station-level tags, not dependable current-song or upcoming-program metadata, so Radio filtering never claims either. Direct playback exposes the listener's IP address to the broadcaster, whose own stream terms apply.
diff --cc README.md
index 296dea494,a4ce6c568..1722914a8
--- a/README.md
+++ b/README.md
@@@ -377,7 -377,7 +377,7 @@@ Twenty layers and map sources. **Eighte
| 🌍 **Earthquakes** | Global seismic activity, last 24h | USGS | 🟢 |
| ◍ **Air quality** | Live AQHI on the published 1–10+ health-risk scale, with a Weather-panel card showing the band legend and the highest readings in view. **Canada only** — ECCC is the first registered provider | ECCC MSC GeoMet | 🟢 |
| 🚗 **Traffic** | Simulated vehicles on OSM roads. With TomTom, live flow speeds drive the simulation and congestion colors below ~8 km; individual vehicle positions are not live observations | TomTom + OSM | 🟢 simulation · 🟡 live flow speeds |
- | 📹 **CCTV Mesh** | ~4,000 public cameras projected _into_ the 3D space — Austin · Texas (TxDOT) · California (Caltrans) · London (TfL) · Ontario (511) · Finland (Fintraffic) · British Columbia (DriveBC) · Estonia (Tallinn, Tarktee) · Delaware (DelDOT live video) · New South Wales (Live Traffic NSW) · Calgary · Norway (Statens vegvesen) · Washington (WSDOT), plus opt-in New York City (NYC DOT TMC, needs your own NYC DOT agreement). Positions are published; poses are estimated priors **you calibrate by dragging a gizmo on the camera itself** | City APIs | 🟢 |
-| 📹 **CCTV Mesh** | ~4,000 public cameras (shared cap) projected _into_ the 3D space — Austin · Texas (TxDOT) · California (Caltrans) · London (TfL) · Ontario (511) · Finland (Fintraffic) · British Columbia (DriveBC) · Estonia (Tallinn, Tarktee) · Delaware (DelDOT live video) · New South Wales (Live Traffic NSW) · Calgary · Norway (Statens vegvesen) · Toronto · King County (WA), plus opt-in New York City (NYC DOT TMC, needs your own NYC DOT agreement). Positions are published; poses are estimated priors **you calibrate by dragging a gizmo on the camera itself** | City APIs | 🟢 |
++| 📹 **CCTV Mesh** | ~4,000 public cameras (shared cap) projected _into_ the 3D space — Austin · Texas (TxDOT) · California (Caltrans) · London (TfL) · Ontario (511) · Finland (Fintraffic) · British Columbia (DriveBC) · Estonia (Tallinn, Tarktee) · Delaware (DelDOT live video) · New South Wales (Live Traffic NSW) · Calgary · Norway (Statens vegvesen) · Toronto · King County (WA) · Washington (WSDOT), plus opt-in New York City (NYC DOT TMC, needs your own NYC DOT agreement). Positions are published; poses are estimated priors **you calibrate by dragging a gizmo on the camera itself** | City APIs | 🟢 |
| 📷 **Mapped ALPR Cameras** | License-plate-reader camera locations tagged by OpenStreetMap contributors, loaded one city-sized view at a time, with **SHOW NEAREST**. Locations and tags only: no plate data, no video | OpenStreetMap (incl. DeFlock mapping) | 🟢 |
| 📷 **Street Level** | Street-level photos behind one panel, one chip per provider: coverage on the streets, image cones, an embedded viewer and **FOLLOW**. Mapillary, Google Street View, KartaView and Panoramax | Mapillary · Google · KartaView · Panoramax | 🟢 KartaView, Panoramax · 🟡 Mapillary token · 🔴 Google Maps key |
| 📻 **Radio** | Geolocated world radio with an **analog tuner** — drag the needle across up to 750 stations and the globe flies to each broadcaster | Radio Browser / broadcasters | 🟢 |
diff --cc docs/CURRENT-STATE.md
index ebc081cd7,e682300dd..d0563debc
--- a/docs/CURRENT-STATE.md
+++ b/docs/CURRENT-STATE.md
@@@ -3192,7 -3210,7 +3210,7 @@@ its criteria cannot be silently ignored
| Satellites | CelesTrak | `src/data/satellites.js` | `/api/celestrak` | 120s |
| Space Missions (30d) | Launch Library 2 + CelesTrak | `src/data/rocketLaunches.js` | `/api/launches` + `/api/celestrak/active` | 5 min |
| Traffic | Selectable TomTom / OpenStreetMap / Hybrid roads; optional TomTom flow (BYOK) | `src/data/traffic.js` | browser-direct OpenFreeMap tiles; `/api/tomtom` for flow | viewport-driven; capped tile cache |
- | CCTV | Austin + Caltrans (CA) + TfL London + Ontario 511 + Fintraffic (FI) + DriveBC (BC) + TxDOT (TX) + Estonia (Tallinn, Tarktee) + Live Traffic NSW + Open Calgary Open Data + Statens vegvesen (NO, stills + live HLS) + WSDOT (WA) Open Data + NYC DOT TMC (opt-in) + Street View fallback | `src/data/cctv.js` | `/api/cctv` | 10s (active) |
-| CCTV | Austin + Caltrans (CA) + TfL London + Ontario 511 + Fintraffic (FI) + DriveBC (BC) + TxDOT (TX) + Estonia (Tallinn, Tarktee) + Live Traffic NSW + Open Calgary Open Data + Statens vegvesen (NO, stills + live HLS) + King County (WA) Open Data + NYC DOT TMC (opt-in) + City of Toronto RESCU + Street View fallback | `src/data/cctv.js` | `/api/cctv` | 10s (active) |
++| CCTV | Austin + Caltrans (CA) + TfL London + Ontario 511 + Fintraffic (FI) + DriveBC (BC) + TxDOT (TX) + Estonia (Tallinn, Tarktee) + Live Traffic NSW + Open Calgary Open Data + Statens vegvesen (NO, stills + live HLS) + King County (WA) Open Data + WSDOT (WA) Open Data + NYC DOT TMC (opt-in) + City of Toronto RESCU + Street View fallback | `src/data/cctv.js` | `/api/cctv` | 10s (active) |
| Radio | Radio Browser (public-domain station directory) | `src/data/radio.js` | `/api/radio/stations`, `/api/radio/click/:uuid` | 45 min directory refresh |
| Transit 🚌 | Operator GTFS-Realtime VehiclePositions (7 keyless regions, `src/data/transitFeeds.js`) | `src/layers/transit/` via `src/app/layers/transit.js` | `/api/transit` | 15s (poll + delayed playback) |
| Bikeshare 🚲 | GBFS (Lyft + BCycle + Social Bicycles + PBSC incl. Bike Share Toronto + Urban Sharing, Entur, JCDecaux NO) | `src/data/bikeshare.js` | `/api/gbfs` | 60s |
diff --cc server/providers/cctv/catalog.js
index 5963beac0,9852b91b9..d9640006f
--- a/server/providers/cctv/catalog.js
+++ b/server/providers/cctv/catalog.js
@@@ -18,9 -18,10 +18,11 @@@ import
loadNswSourcesFromOpenData,
loadCalgarySourcesFromOpenData,
loadDelDOTSourcesFromOpenData,
+ loadKingCountySourcesFromOpenData,
+ loadWsdotSourcesFromOpenData,
loadVegvesenSourcesFromOpenData,
loadNycSourcesFromOpenData,
+ loadTorontoSourcesFromOpenData,
} from './sources.js';
/** Env kill switch: unset or anything but "0" means enabled. */
@@@ -98,11 -99,11 +100,16 @@@ const LIVE_PACKS =
enabled: () => envEnabled('CCTV_DELDOT_ENABLED'),
load: loadDelDOTSourcesFromOpenData,
},
+ {
+ name: 'kingcounty',
+ enabled: () => envEnabled('CCTV_KINGCOUNTY_ENABLED'),
+ load: loadKingCountySourcesFromOpenData,
+ },
+ {
+ name: 'wsdot',
+ enabled: () => envEnabled('CCTV_WSDOT_ENABLED'),
+ load: loadWsdotSourcesFromOpenData,
+ },
{
name: 'vegvesen',
enabled: () => envEnabled('CCTV_VEGVESEN_ENABLED'),
diff --cc server/providers/cctv/constants.js
index 883fb0b47,56b7454de..cb01909aa
--- a/server/providers/cctv/constants.js
+++ b/server/providers/cctv/constants.js
@@@ -306,26 -306,61 +306,81 @@@ export const DELDOT_ANCHORS =
{ lat: 38.6906, lon: -75.3877 }, // Georgetown (Sussex)
];
+ /** King County, WA road cameras: keyless public ArcGIS FeatureServer layer
+ * ("King County and WSDOT Traffic Cameras", King County DOT Road Services).
+ * GeoJSON with WGS84 point geometry. `outFields` is an explicit list on
+ * purpose: the layer also carries asset-administration columns (including
+ * staff names in `ModifiedBy`) that must never be fetched. Uniquely among the
+ * packs, the county publishes each camera's hardware `Manufacturer`/`Model`
+ * (Cohu 3950/3965, Bosch AUTODOME, Axis Q6135-LE, …), carried through as the
+ * source's `model`. */
+ export const KING_COUNTY_CAMERAS_URL =
+ 'https://services.arcgis.com/Ej0PsM5Aw677QF1W/arcgis/rest/services/TRAFFICCAMERA_POINT_2029/FeatureServer/0/query?where=1%3D1&outFields=AssetID,Location,ImageURL,Live,Model,Manufacturer,Owner,CurrentStatus&f=geojson';
+ /** Frames come only from the county's own image handler host. */
+ export const KING_COUNTY_IMAGE_ORIGIN = 'https://info.kingcounty.gov/';
+ /** The whole catalog is ~125 rows (~59 live county cameras); no thinning by
+ * default. */
+ export const DEFAULT_KING_COUNTY_MAX_SOURCES = 125;
+ /** Prioritization anchor: Renton, roughly central to the county road network. */
+ export const KING_COUNTY_ANCHORS = [{ lat: 47.4829, lon: -122.2171 }];
+ /** Hard ceiling on the King County catalog body. The whole layer is ~125 rows
+ * and well under 100 KB; this only exists so an upstream that streams an
+ * unbounded body cannot be buffered without limit. */
+ export const KING_COUNTY_MAX_CATALOG_BYTES = 1024 * 1024;
+ /**
+ * City of Toronto RESCU traffic cameras: the municipal network the province's
+ * 511 pack does not cover — downtown arterials plus the Gardiner, DVP, Allen
+ * and Lake Shore. One keyless list for the whole city (~336 cameras), from the
+ * City's open data portal. It is fetched on every catalog refresh, but the
+ * upstream file is not updated often and may lag the live camera network.
+ *
+ * The list is served as JSONP (`jsonTMCEarthCamerasCallback({...})`); the
+ * portal publishes the same data as .xml and .csv beside it.
+ */
+ export const TORONTO_RESCU_LIST_URL =
+ 'https://opendata.toronto.ca/transportation/tmc/rescucameraimages/Data/tmcearthcameras.json';
+ /**
+ * The only origin Toronto camera frames may come from. The list carries no URL
+ * field: frame URLs are BUILT from this origin and a strictly-digits camera
+ * number (`loc####.jpg`, the convention the dataset documents), so no upstream
+ * field can steer the frame proxy off-host.
+ */
+ export const TORONTO_RESCU_IMAGE_ORIGIN =
+ 'https://opendata.toronto.ca/transportation/tmc/rescucameraimages/CameraImages/';
+ /** The whole city fits under this; the cap exists to stay tunable, not to trim. */
+ export const DEFAULT_TORONTO_MAX_SOURCES = 336;
+ /** Yonge / Queen: the prioritization anchor. */
+ export const TORONTO_DOWNTOWN = { lat: 43.6532, lon: -79.3832 };
+ /** The city climbs from 76 m at the lake to 209 m at Steeles, so no single
+ * number fits: this is the mean across the 336 camera sites. The ground-height
+ * sidecar has no Toronto entries yet, so this prior seeds placement; a camera
+ * that gains a sidecar entry uses it instead, and the client's ground snap
+ * corrects the prior wherever 3D tiles are loaded. */
+ export const TORONTO_GROUND_ELEVATION_M = 116;
+ /** Hard ceiling on the RESCU list body. The whole city is ~336 rows and under
+ * 60 KB; this only exists so an upstream that streams an unbounded body cannot
+ * be buffered without limit. */
+ export const TORONTO_MAX_CATALOG_BYTES = 4 * 1024 * 1024;
+/** WSDOT Travel Center cameras (Washington State): keyless Esri JSON on the
+ * official open-data host — ~1,700 point features in EPSG:3857 (Web Mercator),
+ * ETag/Last-Modified served. WSDOT's metadata marks the feed "low volume" use;
+ * the catalog is fetched once per CCTV_SOURCE_CACHE_MS refresh. */
+export const WSDOT_CAMERAS_URL =
+ 'https://data.wsdot.wa.gov/travelcenter/Cameras.json';
+/** Only frames on WSDOT's own image host are registered; the catalog also
+ * lists ~70 partner cameras (Oregon DOT, City of Seattle, lodges, airports)
+ * whose own terms apply. */
+export const WSDOT_IMAGE_ORIGIN = 'https://images.wsdot.wa.gov/';
+export const DEFAULT_WSDOT_MAX_SOURCES = 250;
+/** Hard ceiling on the WSDOT catalog body. The live layer is ~400 KB; this
+ * only exists so an upstream that streams an unbounded body cannot be
+ * buffered without limit. */
+export const WSDOT_MAX_CATALOG_BYTES = 4 * 1024 * 1024;
+/** Prioritization anchors: downtown Seattle and Spokane. */
+export const WSDOT_ANCHORS = [
+ { lat: 47.6062, lon: -122.3321 }, // Seattle
+ { lat: 47.6588, lon: -117.426 }, // Spokane
+];
/** Camera CATALOGS change rarely; 15 min keeps multi-megabyte upstream list refetches (Austin rows.json + 4 Caltrans districts + TfL + Ontario 511) infrequent. Frames are fetched per-request and are unaffected. */
export const CCTV_SOURCE_CACHE_MS = 15 * 60 * 1000;
diff --cc server/providers/cctv/sources.js
index 56673014e,03bd859d1..155442600
--- a/server/providers/cctv/sources.js
+++ b/server/providers/cctv/sources.js
@@@ -59,11 -65,11 +65,16 @@@ import
DELDOT_CCTV_URL,
DEFAULT_DELDOT_MAX_SOURCES,
DELDOT_ANCHORS,
+ KING_COUNTY_CAMERAS_URL,
+ KING_COUNTY_IMAGE_ORIGIN,
+ DEFAULT_KING_COUNTY_MAX_SOURCES,
+ KING_COUNTY_ANCHORS,
+ KING_COUNTY_MAX_CATALOG_BYTES,
+ WSDOT_CAMERAS_URL,
+ WSDOT_IMAGE_ORIGIN,
+ DEFAULT_WSDOT_MAX_SOURCES,
+ WSDOT_ANCHORS,
+ WSDOT_MAX_CATALOG_BYTES,
DEFAULT_VEGVESEN_CCTV_URL,
VEGVESEN_IMAGE_ORIGIN,
VEGVESEN_VIDEO_URL,
@@@ -102,8 -109,8 +114,9 @@@ import
} from './normalize.js';
import { directionToHeading } from '../../../src/data/directionText.js';
import {
+ readResponseBytesCapped,
readResponseJsonCapped,
+ readResponseTextCapped,
} from '../common/http.js';
/**
* Fetch and parse Austin traffic camera records from the city Open Data portal.
@@@ -1725,160 -1732,165 +1738,319 @@@ export async function loadDelDOTSources
}
}
+ /** Rough King County, WA bounding box. */
+ function isLikelyKingCountyCoordinate(lat, lon) {
+ return (
+ Number.isFinite(lat) &&
+ Number.isFinite(lon) &&
+ lat >= 47.0 &&
+ lat <= 48.0 &&
+ lon >= -123.1 &&
+ lon <= -121.0
+ );
+ }
+
+ /**
+ * A King County `Model` value, whitespace-collapsed, or '' when it is a
+ * vendor-generic string ("PTZ", "PTZ IP", "BOSCH/PTZ") that names no model.
+ */
+ function kingCountyModel(raw) {
+ const model = String(raw || '')
+ .replace(/\s+/g, ' ')
+ .trim();
+ return /^(?:[a-z]+\/)?ptz(?: ip)?$/i.test(model) ? '' : model;
+ }
+
+ /**
+ * Fetch King County road cameras (Washington State). Keyless: one public
+ * ArcGIS FeatureServer GeoJSON query (King County DOT Road Services), with an
+ * explicit `outFields` list so the layer's asset-administration columns are
+ * never fetched. Only cameras that are live and active (`Live`,
+ * `CurrentStatus`) with a positive integer id, finite in-county coordinates,
+ * and a frame on the county's own image handler are kept. WSDOT-owned rows in
+ * the layer are skipped because their frames are WSDOT-hosted, outside the
+ * pinned image origin, while partner-city cameras hosted on the county image
+ * handler (e.g. Newcastle) name their owner as the per-camera credit,
+ * DriveBC-style. The layer publishes no facing, so every heading is the id
+ * hash at low confidence.
+ *
+ * Uniquely among the packs, the county publishes each camera's hardware
+ * `Manufacturer`/`Model`; the model string (whitespace-collapsed — the feed
+ * carries stray newlines) rides along as the source's `model` for
+ * identified-hardware consumers. Vendor-generic strings ("PTZ", "PTZ IP",
+ * "BOSCH/PTZ") name no model and are treated as absent.
+ *
+ * @returns {Promise<Array<object>>} Normalized camera source objects.
+ */
+ export async function loadKingCountySourcesFromOpenData() {
+ try {
+ const resp = await fetch(KING_COUNTY_CAMERAS_URL, {
+ headers: { Accept: 'application/json' },
+ redirect: 'manual',
+ signal: AbortSignal.timeout(CCTV_SOURCE_FETCH_TIMEOUT_MS),
+ });
+ // A response this loader will not read still owns its transport until the
+ // body is released, so every rejection path cancels before returning.
+ const discard = async () => {
+ try {
+ await resp.body?.cancel();
+ } catch {
+ /* no-op */
+ }
+ return [];
+ };
+ if (resp.status >= 300 && resp.status < 400) {
+ console.warn(
+ '[CCTV] King County catalog redirected; redirects are not followed',
+ );
+ return discard();
+ }
+ if (!resp.ok) {
+ console.warn('[CCTV] King County camera download failed:', resp.status);
+ return discard();
+ }
+ const payload = await readResponseJsonCapped(
+ resp,
+ KING_COUNTY_MAX_CATALOG_BYTES,
+ );
+ const rows = Array.isArray(payload?.features) ? payload.features : [];
+
+ const cameras = [];
+ const seen = new Set();
+ for (const row of rows) {
+ const attrs = row?.properties;
+ const rawId = attrs?.AssetID;
+ if (!Number.isSafeInteger(rawId) || rawId <= 0) continue;
+ if (attrs.Live !== 1) continue;
+ if (String(attrs.CurrentStatus || '').trim() !== 'Active') continue;
+ const owner = String(attrs.Owner || '').trim();
+ // WSDOT-owned rows serve WSDOT-hosted frames, outside the pinned
+ // county image origin, so they are skipped.
+ if (owner === 'WSDOT') continue;
+ // The handler is served over HTTPS; the feed still writes http://.
+ const imageUrl = String(attrs.ImageURL || '')
+ .trim()
+ .replace(/^http:\/\/info\.kingcounty\.gov\//, KING_COUNTY_IMAGE_ORIGIN);
+ if (!imageUrl.startsWith(KING_COUNTY_IMAGE_ORIGIN)) continue;
+ const [lon, lat] = Array.isArray(row?.geometry?.coordinates)
+ ? row.geometry.coordinates
+ : [];
+ if (!isLikelyKingCountyCoordinate(lat, lon)) continue;
+
+ const cameraId = `kingcounty-${rawId}`;
+ if (seen.has(cameraId)) continue;
+ seen.add(cameraId);
+ const model = kingCountyModel(attrs.Model);
+ const manufacturer = String(attrs.Manufacturer || '')
+ .replace(/\s+/g, ' ')
+ .trim();
+ const camera = {
+ id: cameraId,
+ name:
+ String(attrs.Location || '').trim() || `King County camera ${rawId}`,
+ city: 'King County',
+ cityId: 'king-county',
+ provider: 'King County Road Services',
+ lat,
+ lon,
+ headingDeg: fallbackHeadingFromId(cameraId),
+ headingConfidence: 'low',
+ // The low-confidence pose personality shared by the other packs.
+ pitchDeg: -18,
+ fovDeg: 44,
+ rangeM: 145,
+ mountHeightM: 8,
+ feedType: 'image',
+ url: imageUrl,
+ snapshotUrl: imageUrl,
+ sourceKind: 'kingcounty-open-data',
+ license: 'King County GIS open data (KCGIS Center terms of use)',
+ credit: owner && owner !== 'King County' ? owner : '',
+ };
+ if (model) camera.model = model;
+ if (model && manufacturer) camera.manufacturer = manufacturer;
+ cameras.push(camera);
+ }
+
+ const maxRaw = Number(
+ process.env.CCTV_KINGCOUNTY_MAX_SOURCES ||
+ DEFAULT_KING_COUNTY_MAX_SOURCES,
+ );
+ const maxCount = Number.isFinite(maxRaw)
+ ? Math.max(8, Math.min(1200, Math.floor(maxRaw)))
+ : DEFAULT_KING_COUNTY_MAX_SOURCES;
+ const prioritized = prioritizeSources(
+ cameras,
+ maxCount,
+ KING_COUNTY_ANCHORS,
+ );
+ console.log(
+ `[CCTV] Loaded King County camera sources: ${cameras.length} published (using nearest ${prioritized.length})`,
+ );
+ return prioritized;
+ } catch (error) {
+ console.warn(
+ '[CCTV] King County camera download error:',
+ error?.message || error,
+ );
+ return [];
+ }
+ }
+
+/** WSDOT `CompassDirection` codes as headings in degrees. The live feed sends
+ * single cardinals (N/E/S/W), `B` (both directions — most rows), `O`, and
+ * null; the diagonals are mapped in case they appear. `B`, `O`, null, and any
+ * other code carry no single facing and fall through to the id hash. */
+const WSDOT_COMPASS_HEADINGS = Object.freeze({
+ N: 0,
+ NE: 45,
+ E: 90,
+ SE: 135,
+ S: 180,
+ SW: 225,
+ W: 270,
+ NW: 315,
+});
+
+/**
+ * Converts an EPSG:3857 (Web Mercator) coordinate pair to WGS84 degrees.
+ * The WSDOT camera layer publishes point geometry in wkid 102100.
+ * @param {number} x - Web Mercator metres east.
+ * @param {number} y - Web Mercator metres north.
+ * @returns {{lat: number, lon: number}} WGS84 degrees.
+ */
+export function webMercatorToWgs84(x, y) {
+ const R = 6378137;
+ const lon = (x / R) * (180 / Math.PI);
+ const lat = (2 * Math.atan(Math.exp(y / R)) - Math.PI / 2) * (180 / Math.PI);
+ return { lat, lon };
+}
+
+/** Rough Washington State bounding box (with the Columbia River border cams). */
+function isLikelyWashingtonCoordinate(lat, lon) {
+ return (
+ Number.isFinite(lat) &&
+ Number.isFinite(lon) &&
+ lat >= 45.3 &&
+ lat <= 49.3 &&
+ lon >= -125 &&
+ lon <= -116.5
+ );
+}
+
+/**
+ * Fetch WSDOT highway cameras (Washington State). Keyless: one Esri JSON
+ * layer on WSDOT's official open-data host (the same layer the WSDOT Travel
+ * Center map consumes; a keyed Traveler Information API serves the identical
+ * population for higher-volume use). Only cameras with a positive integer id,
+ * finite in-state coordinates, and a frame on WSDOT's own image host are
+ * kept — the catalog's ~70 partner cameras (Oregon DOT, City of Seattle,
+ * lodges, airports) are skipped rather than proxied under someone else's
+ * terms. A single-facing `CompassDirection` (a cardinal) gives a
+ * high-confidence heading; `B` (both directions), `O`, and null fall back to
+ * the id hash.
+ * The feed carries Windows-1252 bytes (en-dashes in titles) with no charset
+ * declaration, so the body is decoded explicitly before parsing.
+ *
+ * @returns {Promise<Array<object>>} Normalized camera source objects.
+ */
+export async function loadWsdotSourcesFromOpenData() {
+ try {
+ const resp = await fetch(WSDOT_CAMERAS_URL, {
+ headers: { Accept: 'application/json' },
+ redirect: 'manual',
+ signal: AbortSignal.timeout(CCTV_SOURCE_FETCH_TIMEOUT_MS),
+ });
+ const discard = async () => {
+ try {
+ await resp.body?.cancel();
+ } catch {
+ /* no-op */
+ }
+ return [];
+ };
+ if (resp.status >= 300 && resp.status < 400) {
+ console.warn(
+ '[CCTV] WSDOT catalog redirected; redirects are not followed',
+ );
+ return discard();
+ }
+ if (!resp.ok) {
+ console.warn('[CCTV] WSDOT camera download failed:', resp.status);
+ return discard();
+ }
+ const payload = JSON.parse(
+ new TextDecoder('windows-1252').decode(
+ await readResponseBytesCapped(resp, WSDOT_MAX_CATALOG_BYTES),
+ ),
+ );
+ const rows = Array.isArray(payload?.features) ? payload.features : [];
+
+ const cameras = [];
+ for (const row of rows) {
+ const attrs = row?.attributes;
+ const rawId = attrs?.CameraID;
+ if (!Number.isSafeInteger(rawId) || rawId <= 0) continue;
+ const imageUrl = String(attrs.ImageURL || '').trim();
+ if (!imageUrl.startsWith(WSDOT_IMAGE_ORIGIN)) continue;
+ const x = row?.geometry?.x;
+ const y = row?.geometry?.y;
+ if (!Number.isFinite(x) || !Number.isFinite(y)) continue;
+ const { lat, lon } = webMercatorToWgs84(x, y);
+ if (!isLikelyWashingtonCoordinate(lat, lon)) continue;
+
+ const cameraId = `wsdot-${rawId}`;
+ const heading =
+ WSDOT_COMPASS_HEADINGS[
+ String(attrs.CompassDirection || '')
+ .trim()
+ .toUpperCase()
+ ];
+ const hasHeading = Number.isFinite(heading);
+ cameras.push({
+ id: cameraId,
+ name: String(attrs.CameraTitle || '').trim() || `WSDOT camera ${rawId}`,
+ city: 'Washington',
+ cityId: 'washington-state',
+ provider: 'WSDOT',
+ lat,
+ lon,
+ headingDeg: hasHeading ? heading : fallbackHeadingFromId(cameraId),
+ headingConfidence: hasHeading ? 'high' : 'low',
+ // Same two pose personalities as the other packs: raw priors that the
+ // client's ground snap and manual calibration refine.
+ pitchDeg: hasHeading ? -24 : -18,
+ fovDeg: hasHeading ? 56 : 44,
+ rangeM: hasHeading ? 210 : 145,
+ mountHeightM: hasHeading ? 10 : 8,
+ feedType: 'image',
+ url: imageUrl,
+ snapshotUrl: imageUrl,
+ sourceKind: 'wsdot-open-data',
+ license: 'WSDOT Travel Center camera data (public low-volume feed)',
+ });
+ }
+
+ const maxRaw = Number(
+ process.env.CCTV_WSDOT_MAX_SOURCES || DEFAULT_WSDOT_MAX_SOURCES,
+ );
+ const maxCount = Number.isFinite(maxRaw)
+ ? Math.max(8, Math.min(1200, Math.floor(maxRaw)))
+ : DEFAULT_WSDOT_MAX_SOURCES;
+ const prioritized = prioritizeSources(cameras, maxCount, WSDOT_ANCHORS);
+ console.log(
+ `[CCTV] Loaded WSDOT camera sources: ${cameras.length} published (using nearest ${prioritized.length})`,
+ );
+ return prioritized;
+ } catch (error) {
+ console.warn(
+ '[CCTV] WSDOT camera download error:',
+ error?.message || error,
+ );
+ return [];
+ }
+}
+
/**
* One Statens vegvesen `CctvSimple` feature -> one catalog source, or null.
*