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 main (82022306) into fix/flights-unpositioned-rows-complete

Mazeyar Moeini Feizabadi2e4beb941896
diff --cc CHANGELOG.md
index c608afa5a,58589e626..88d252b81
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -1,10 -1,133 +1,138 @@@
# Changelog
+- Flights age out vanished aircraft again. OpenSky's routine position-less rows
+ no longer mark every snapshot partial, which had kept vanished and landed
+ aircraft at full opacity for up to five minutes; those rows retain only their
+ own aircraft, and a likely-landed one still leaves on the landed limit.
+
+ - 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).
+
+ - Refuse still-image cameras on the CCTV media relay. `/api/cctv/media` is the
+ live-feed route, but it also relayed any registered still camera through an
+ ordinary fetch that followed redirects to any host, passed through whatever
+ content type came back and had no cap on the body, bypassing every protection
+ `/api/cctv/frame` applies to the same URL. Only HLS, MP4, WebM and MJPEG
+ feeds are relayed now; a still camera, or an unknown id, gets a JSON 404
+ without an upstream request and is served only through `/api/cctv/frame`.
+ The client already loaded stills through `/frame`, so nothing it requests
+ changes.
+
+ - Add Lithuania's public Via Lietuva / Eismoinfo road cameras to CCTV, with published coordinates, on-demand snapshots, attribution and bounded catalog requests. No API key is required. The pack is opt-in (`CCTV_LITHUANIA_ENABLED=1`) because its camera endpoints are the eismoinfo.lt website backend, not a service listed in Via Lietuva's open-data statement, so the licence for the photos is unconfirmed.
+
+ - 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
+ never activates again. A dead feed re-entering camera range therefore latched
+ LOAD FAILED permanently over a map still drawing every other city's stations.
+ Failure is now tracked per city: a city that fails beside others still
+ drawing marks the layer DEGRADED, polls that all fail over previously drawn
+ points read STALE without advancing freshness, and LOAD FAILED is reported
+ only when nothing is left to draw. A city that recovers clears its own
+ failure, a failure is dropped once its city leaves range or the camera rises
+ above the activation altitude, and late results from superseded requests are
+ ignored.
+
+ Repointed the three feeds whose operators had moved: Reddy Bikeshare (Buffalo)
+ to Social Bicycles, Tugo (Tucson) and Trinity Metro (Fort Worth) to PBSC.
+ Dropped CoGo (Columbus) and Broward B-cycle (Fort Lauderdale), whose systems
+ have wound down — CoGo's feed reports no stations and last moved a bike in
+ March 2025. The three repointed feeds were verified live.
+
+ - Add Bike Share Toronto (1,069 stations) to the bikeshare registry. The system
+ publishes the same PBSC GBFS v2 feeds as the Austin, Honolulu and Chattanooga
+ entries, so it needs no new plumbing; a registry test now holds every city's
+ feed URLs against the proxy host and path allowlists, so a city the proxy
+ would refuse fails the suite instead of rendering an empty layer.
+
+ - GBFS v3 station names use English translations when available, then the first
+ usable translation or short name. Empty or malformed names no longer appear as
+ `[object Object]` or interrupt station loading; legacy string names remain
+ supported in the globe and bike-share tools. Thanks to
+ [Kristóf Kékesi](https://github.com/KristofKekesi) (#61).
+
+ - Overpass and military-installation disk caches no longer serve answers from a
+ previously configured `OVERPASS_UPSTREAMS` instance after it is repointed.
+
+ - A Radio Browser mirror answering 204, 205 or 304, or a status outside
+ 200–599, no longer crashes the local dev/preview server. Null-body statuses
+ get an empty body; anything else that cannot become a response fails that
+ mirror so the next one is tried.
+
+ - Snow flakes sway within a fixed range instead of drifting sideways faster the
+ longer the app runs; the Wind setting still scales the sway.
+
+ - The right rail ignores panels that other CSS hides, such as during an event
+ view, so they no longer force one-panel-at-a-time layout or collapse visible
+ panels. Panels the rail collapses itself are still restored.
+
+ - Coordinate searches refuse empty latitude or longitude components instead of navigating to an unintended location.
+
+ - Bing Aerial and Bing Labels request HTTPS tiles on HTTP localhost through
+ their ion-backed providers, retaining ion and per-tile attribution without
+ widening the Content Security Policy.
+
+ - Add New York City traffic cameras from the NYC DOT Traffic Management Center
+ as an opt-in CCTV pack. NYC DOT requires a data-sharing agreement for the
+ camera feed, so the pack is off unless `CCTV_NYC_ENABLED=1` is set by an
+ operator who holds one; otherwise no request reaches NYC DOT. NYC DOT's
+ requested disclaimer is in the Data attribution popover. The camera list is one keyless JSON request to
+ `webcams.nyctmc.org/api/cameras`; frames are stills synthesized from each
+ camera UUID on that same host, so a catalog field cannot steer the proxy
+ off-host. Offline cameras are dropped. Once enabled, the 250 cameras nearest
+ the five borough cores load and `CCTV_NYC_MAX_SOURCES` changes the cap. The catalog-wide ceiling is
+ unchanged; extra cameras share it round-robin with the other packs.
+
+ - Street Level counts unique tiles before ranking so overlapping dateline halves
+ in polar views do not waste slots in the 16-tile overview budget.
+
+ - Directions no longer shows a truncation notice for a route with exactly 200
+ turns, and a roundabout at the 200th turn keeps its exit distance.
+
+ - Weather records keep missing conditions unknown and refuse summaries without a measured temperature.
+
+ - Tool string length validation counts Unicode characters correctly, including characters outside the basic multilingual plane.
+
+ - Director timeline seeks cross the dateline along the short longitude arc.
+
+ - Recent Imagery continues past malformed records in full catalog pages, respects the requested record limit, and reports results as truncated when that limit drops valid records.
+
+ - Regional articles retain unknown publication times when compact source dates do not identify a real calendar instant.
+
+ - Add Detroit (MoGo), Pittsburgh (POGOH), Aspen (WE-cycle) and Kona & Hilo
+ (HIBike) to the GBFS bikeshare registry, the layer's first stations in
+ Michigan.
+
- Treat explicitly current, complete empty vessel coverage as a successful update,
clearing obsolete contacts while retaining stale or incomplete snapshots.
diff --cc src/layers/flights/records.test.mjs
index 783b6d06a,fff25b8b9..638c6f843
--- a/src/layers/flights/records.test.mjs
+++ b/src/layers/flights/records.test.mjs
@@@ -107,26 -107,12 +107,36 @@@ test('ground transitions preserve last
assert.equal(next.meta.wasAirborne, true);
});
+test('complete snapshots age out vanished aircraft and retain position-less ones unless landed', () => {
+ const store = records();
+ for (const id of ['abc123', 'def456', 'ghi789'])
+ store.receive(observation({ id, reference: id }), view());
+ // abc123 and ghi789 are still listed without a position; def456 vanished.
+ const absent = (id, likelyLanded = false) =>
+ store.absence(id, {
+ complete: true,
+ retainIds: new Set(['abc123', 'ghi789']),
+ likelyLanded,
+ });
+ assert.deepEqual(
+ [absent('def456'), absent('def456'), absent('def456')],
+ ['stale', 'stale', 'remove'],
+ );
+ assert.equal(absent('abc123'), 'retain');
+ assert.equal(store.missingPolls.has('abc123'), false);
+ // A landed contact that lost its position takes the landed fast-cull.
+ assert.equal(absent('ghi789', true), 'remove');
+ // Position-less retention stays bounded like partial admission.
+ store.data.get('abc123').observedReceiptMs = Date.now() - 300001;
+ assert.equal(absent('abc123'), 'stale');
+});
++
+ test('civil emergency status follows the latest poll instead of sticking', () => {
+ const store = records();
+ const first = store.receive(observation({ squawk: '7700' }), view());
+ assert.equal(first.meta.squawk, '7700');
+ assert.equal(first.meta.emergency.kind, 'general');
+ const next = store.receive(observation({ squawk: '2000' }), view());
+ assert.equal(next.meta.squawk, '2000');
+ assert.equal(next.meta.emergency, null);
+ });
diff --cc src/sources/live/aircraft.js
index 1ba3af603,ebc27f559..1af1f6b47
--- a/src/sources/live/aircraft.js
+++ b/src/sources/live/aircraft.js
@@@ -94,9 -88,14 +100,15 @@@ export function openSkySnapshot
) {
const admitted = admitRecords(
payload?.states,
- normalizeOpenSkyAircraft,
+ (row) => {
+ const record = normalizeOpenSkyAircraft(row);
+ const statuses = payload?.emergencyByIcao;
+ if (record && statuses && Object.hasOwn(statuses, record.id))
+ record.emergency = cleanText(statuses[record.id]).toLowerCase() || null;
+ return record;
+ },
'OpenSky',
+ openSkyUnpositionedId,
);
const observedAtMs = epoch(payload?.time, 1000);
const ageMs = observedAtMs == null ? null : Math.max(0, now - observedAtMs);