A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.
JavaScript 3d-globecesiumflight-trackinggeospatialgeospatial-intelligencegisosintphotogrammetrysatellite-trackingspatial-intelligencewebglworldview
Merge remote-tracking branch 'upstream/main' into feature/catalonia-cctv-cameras
ulihhhh9ba7cee021f3
diff --cc .env.exampleindex 6f4544e00,ee7620be9..814ad948d--- a/.env.example+++ b/.env.example@@@ -180,8 -192,10 +192,12 @@@ 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_CATALONIA_ENABLED=1 # set 0 to disable the Servei Català de Trànsit cameras+# CCTV_CATALONIA_MAX_SOURCES=150 # cap cameras loaded from Catalonia (~135 exist today)+ # 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+ # CCTV_VEGVESEN_URL= # override the Statens vegvesen catalog URL# CCTV_MAX_SOURCES=4000 # catalog-wide ceiling, shared round-robin across packs# CCTV_PREFER_AUSTIN=1 # prioritize Austin cameras in the registry# CCTV_FORCE_AUSTIN= # force live default sources when a source-pack JSON is configureddiff --cc DATA_SOURCES.mdindex c92384cbc,734e35a69..2d3a1538e--- a/DATA_SOURCES.md+++ b/DATA_SOURCES.md@@@ -54,7 -54,7 +54,8 @@@ 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" |+| **Servei Català de Trànsit** (+ Ajuntament de Barcelona, Ajuntament de Terrassa) | CCTV camera catalog + frames, Catalonia | [Llicència oberta d'ús d'informació - Catalunya](https://web.gencat.cat/ca/generalitat/dades-indicadors/dades-obertes/llicencies) — attribution REQUIRED | "Servei Català de Trànsit"; partner-supplied cameras also name their owner |+ | **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" || **GBFS (Lyft / BCycle)** | Bikeshare availability | Per-feed (attribution-only) | Credit the operator (e.g. Austin BCycle) + its `license_url` || **MBTA / MassDOT** (cdn.mbta.com) | Transit layer live vehicles and up to 15 minutes of recently observed positions, Greater Boston | MBTA / MassDOT open realtime vehicle data, used for the live view and up to fifteen minutes of recently observed positions; published for developer use and not against their use. | Attribution to MBTA / MassDOT (courtesy text) || **CapMetro** (data.texas.gov) | Transit layer live vehicles, Austin TX | CapMetro open realtime vehicle data, used for the live view; published for developer use and not against their use. | Attribution to CapMetro (courtesy text) |@@@ -89,7 -89,7 +90,8 @@@ 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`.+- **Catalonia (Servei Català de Trànsit) cameras.** The camera list is the keyless `https://www.gencat.cat/transit/opendata/cameres.xml` WFS/GML feed, fetched over https with redirects refused and the body read capped at 1 MiB, since the list decides ids, coordinates and which allowlisted frame path is proxied. It carries a `font` field naming the real publisher per camera; this pack keeps SCT's own highway cameras plus hotlinked Barcelona (IMI) and Terrassa municipal cameras (~135 total), each confirmed to return a real frame, so frame URLs are checked against a small host allowlist (`mct.gencat.cat`, `www.bcn.cat`, `emap.terrassa.cat`) rather than one pinned origin (a link carrying `user:pass@` userinfo is rejected even on an allowed host), and every non-SCT camera carries its real owner as a `credit` shown beside the shared `provider`. The feed carries no compass heading, so every camera loads at low heading confidence (same as TfL and Fintraffic). SCT's own feed link (`RenderService`) needed a workaround: it always 302s to a second endpoint (`TransitCamera`) on a Location the upstream hardcodes as plain http even when requested over https — refused by `fetchWithinHost`'s same-origin (scheme-included) redirect policy — and separately, `mct.gencat.cat`'s TLS setup fails the handshake with Node's fetch outright (`ERR_SSL_WRONG_SIGNATURE_TYPE`) even though other HTTP clients complete it. The loader therefore builds the `TransitCamera` URL itself, over plain http, from `RenderService`'s `sctidcam` id, rather than registering the (broken) upstream link — the only transport this one host actually serves to this runtime. Frames are fetched at request time and never stored or redistributed. Disable with `CCTV_CATALONIA_ENABLED=0`.+ - **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.- **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 docs/CURRENT-STATE.mdindex 790d489cc,d4fe022a8..f35ddca0d--- a/docs/CURRENT-STATE.md+++ b/docs/CURRENT-STATE.md@@@ -2851,7 -2919,7 +2919,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 + Catalonia (Servei Català de Trànsit) + 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) + 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) + Catalonia (Servei Català de Trànsit) + 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) | `src/data/bikeshare.js` | `/api/gbfs` | 60s |diff --cc scripts/format-scope.jsonindex 38c192439,662b2a43a..11f59b1db--- a/scripts/format-scope.json+++ b/scripts/format-scope.json@@@ -520,7 -522,7 +522,8 @@@"src/data/cctvEstonia.test.mjs","src/data/cctvWarendorf.test.mjs","src/data/cctvCalgary.test.mjs",+ "src/data/cctvCataloniaSource.test.mjs",+ "src/data/cctvVegvesen.test.mjs","src/data/cctvNswSource.test.mjs","src/data/cctvTxdotSource.test.mjs","src/layers/cctv/source.test.mjs",diff --cc server/providers/cctv/catalog.jsindex f679ba1fe,9bc3b70ec..0b63b6ebc--- a/server/providers/cctv/catalog.js+++ b/server/providers/cctv/catalog.js@@@ -17,8 -17,8 +17,9 @@@ importloadWarendorfSourcesFromCatalog,loadNswSourcesFromOpenData,loadCalgarySourcesFromOpenData,+ loadCataloniaSourcesFromOpenData,loadDelDOTSourcesFromOpenData,+ loadVegvesenSourcesFromOpenData,} from './sources.js';/** Env kill switch: unset or anything but "0" means enabled. */diff --cc server/providers/cctv/constants.jsindex 391c35230,6298e86a0..be6d88364--- a/server/providers/cctv/constants.js+++ b/server/providers/cctv/constants.js@@@ -236,51 -236,37 +236,82 @@@ export const CALGARY_DOWNTOWN = { lat:* body cannot be buffered without limit. */export const CALGARY_MAX_CATALOG_BYTES = 4 * 1024 * 1024;+/**+ * Catalonia traffic cameras (Servei Català de Trànsit): one keyless WFS/GML+ * XML list (verified 2026-09-15, hourly catalog refresh), fetched over https+ * (verified 2026-09-27: same 200 body, no redirect). The feed carries a+ * `font` field naming the actual publisher per camera — SCT's own highway+ * cameras plus hotlinked Barcelona (IMI) and Terrassa municipal cameras are+ * kept, each confirmed to return a real frame. Frame URLs are checked+ * against a host allowlist rather than one pinned origin, since each+ * publisher serves from its own host.+ */+export const CATALONIA_CAMERAS_URL =+ 'https://www.gencat.cat/transit/opendata/cameres.xml';+/** Byte ceiling for the Catalonia catalog read (~90 KB observed 2026-09-27),+ * so a runaway body cannot be buffered without limit. */+export const CATALONIA_MAX_CATALOG_BYTES = 1024 * 1024;+/** Allowed image hosts, one per kept `font` publisher in the feed. */+export const CATALONIA_IMAGE_HOSTS = Object.freeze(+ new Set([+ 'mct.gencat.cat', // SCT+ 'www.bcn.cat', // IMI (Ajuntament de Barcelona)+ 'emap.terrassa.cat', // Ajuntament de Terrassa+ ]),+);+/** Per-`font` partner credit, shown beside the provider in the CCTV panel+ * (same pattern as DriveBC's partner-supplied cameras). SCT is the feed's+ * own publisher and carries no separate credit. */+export const CATALONIA_FONT_CREDIT = Object.freeze({+ IMI: 'Ajuntament de Barcelona',+ Terrassa: 'Ajuntament de Terrassa',+});+/** Ground-elevation priors in metres, by `font`: the feed carries no+ * elevation, and this pack spans sea level (Barcelona) to Terrassa's plateau+ * (~270 m). The client's ground snap corrects these on 3D-tile stacks. */+export const CATALONIA_FONT_ELEVATION_M = Object.freeze({+ SCT: 80,+ IMI: 20,+ Terrassa: 270,+});+export const DEFAULT_CATALONIA_MAX_SOURCES = 150;+/** Prioritization anchors: Barcelona and Terrassa. */+export const CATALONIA_ANCHORS = [+ { lat: 41.3874, lon: 2.1686 }, // Barcelona+ { lat: 41.5636, lon: 2.0111 }, // Terrassa+];++ /** Statens vegvesen (Norway) road cameras: the keyless OGC API Features view+ * of the official DATEX 3.1 CCTV site table, one GeoJSON request for the whole+ * country (~900 cameras). The raw DATEX node needs an account; this view does+ * not. Frames are stills on the agency's camera host. */+ export const DEFAULT_VEGVESEN_CCTV_URL =+ 'https://ogckart-sn1.atlas.vegvesen.no/ogc/features/v1/collections/datex_3_1:CctvSimple/items?f=application/geo%2Bjson&limit=5000';+ /** The only origin Vegvesen camera frames may come from. */+ export const VEGVESEN_IMAGE_ORIGIN =+ 'https://kamera.atlas.vegvesen.no/api/images/';+ /** Live HLS for the ~140 cameras that publish video; only this exact+ * per-camera manifest path is registered. */+ export const VEGVESEN_VIDEO_URL = (cameraId) =>+ `https://kamera.vegvesen.no/public/${cameraId}/manifest.m3u8`;+ /** Above the ~850 working cameras so a default install keeps them all, while+ * staying close to them: the per-pack defaults are meant to sum to no more+ * than DEFAULT_CCTV_MAX_SOURCES. */+ export const DEFAULT_VEGVESEN_MAX_SOURCES = 900;+ /** Hard ceiling on the catalog body. The whole country is ~800 KB. */+ export const VEGVESEN_MAX_CATALOG_BYTES = 8 * 1024 * 1024;+ /** Prioritization anchors: the largest cities from south to north, so a cap+ * keeps national coverage rather than just the capital region. */+ export const NORWAY_ANCHORS = [+ { lat: 59.9139, lon: 10.7522 }, // Oslo+ { lat: 60.3913, lon: 5.3221 }, // Bergen+ { lat: 58.97, lon: 5.7331 }, // Stavanger+ { lat: 63.4305, lon: 10.3951 }, // Trondheim+ { lat: 58.1467, lon: 7.9956 }, // Kristiansand+ { lat: 67.2804, lon: 14.4049 }, // Bodø+ { lat: 69.6492, lon: 18.9553 }, // Tromsø+ ];+/** DelDOT CCTV: one keyless statewide JSON catalog; live video via RTMP-over-HTTP (rtmpt:80). */export const DELDOT_CCTV_URL = 'https://tmc.deldot.gov/json/videocamera.json';export const DEFAULT_DELDOT_MAX_SOURCES = 300;diff --cc server/providers/cctv/sources.jsindex ee83f284e,7ecd3434d..53017a2fe--- a/server/providers/cctv/sources.js+++ b/server/providers/cctv/sources.js@@@ -83,8 -82,7 +89,9 @@@ importisLikelyTexasCoordinate,isLikelyNswCoordinate,isLikelyCalgaryCoordinate,+ isLikelyCataloniaCoordinate,+ decodeNumericEntities,+ isLikelyNorwayCoordinate,cameraDisplayCode,rowArrayToObject,prioritizeSources,diff --cc src/data/dataCredits.jsindex a80055e38,2967f0a2b..851281595--- a/src/data/dataCredits.js+++ b/src/data/dataCredits.js@@@ -240,14 -240,13 +240,21 @@@ export const DATA_CREDITS ='Traffic cameras (Calgary): contains information licensed under the ' +'<a href="https://data.calgary.ca/stories/s/Open-Calgary-Terms-of-Use/u45n-7awa" target="_blank" rel="noopener">Open Government Licence – City of Calgary</a>',},+ {+ key: 'catalonia-cctv',+ html:+ 'CCTV cameras & frames (Catalonia): ' ++ '<a href="https://transit.gencat.cat/" target="_blank" rel="noopener">Servei Català de Trànsit</a> ' ++ '(Llicència oberta d’ús d’informació - Catalunya); some cameras are supplied by partners ' ++ '(Ajuntament de Barcelona, Ajuntament de Terrassa), each named in the CCTV panel',+ },+ {+ key: 'vegvesen-cctv',+ html:+ 'Road cameras (Norway): contains data under the ' ++ '<a href="https://data.norge.no/nlod/en/2.0" target="_blank" rel="noopener">Norwegian licence for Open Government data (NLOD)</a> ' ++ 'distributed by Statens vegvesen',+ },{key: 'gbfs',html: 'Bikeshare availability: GBFS operator feeds (e.g. Austin BCycle)',