feat(satellites): file satellites under six classes with a toggle each

The satellites layer now sorts every object into Stations, Imaging,
Telecom, Starlink, Probes or Debris, each with a chip and a live count on
the layer row. Stations and Imaging show by default; the Starlink chip is
the former DENSE catalog switch. Hidden classes keep their points, so a
toggle needs no reload, and they leave the detection overlay and the voice
position lists.

A class comes, strongest evidence first, from CelesTrak SATCAT (object type
and status, served by a new /api/celestrak-satcat/<group> proxy route and
cached for a day), the bundled UCS Satellite Database pack (operator, owner
country and purpose), name patterns for later launches, and the CelesTrak
group. The core catalog also reads the resource, weather, planet, sar and
science groups. Payloads with no evidence of life launched 20 or more years
ago are filed as debris. The UCS pack, its build script and its data credit
are added.
This commit is contained in:
Denis Groshev committed 2026-11-08 23:34:55 +01:00
1 parent 1b9bb844e6
commit c56f098d07
44 files changed
+2530 -362

No files matched your search

+36
View File
@@ -6,11 +6,24 @@ const GROUPS = new Set([
'galileo',
'geo',
'starlink',
// Imaging coverage beyond the UCS May 2023 snapshot, and science probes.
'resource',
'weather',
'planet',
'sar',
'science',
]);
/** The UCS pack, loaded on first use (see src/data/ucsSatellites.js). */
async function loadBundledUcs() {
const { loadUcsSatellites } = await import('../../data/ucsSatellites.js');
return loadUcsSatellites();
}
/** Read catalog text from the existing group endpoint using a supplied transport. */
export function createSatelliteSource({
fetchImpl = (...args) => globalThis.fetch(...args),
loadUcs = loadBundledUcs,
} = {}) {
return {
async readGroup(group, { signal } = {}) {
@@ -24,5 +37,28 @@ export function createSatelliteSource({
const stale = response.headers?.get?.('x-tle-cache') === 'STALE-ERROR';
return { ok: response.ok, status: response.status, text, stale };
},
/**
* CelesTrak SATCAT records (CSV) for one group: object type, operational
* status and owner, through the proxy's day-long cache.
*/
async readSatcat(group, { signal } = {}) {
if (!GROUPS.has(group)) throw new TypeError('Unknown satellite group');
signal?.throwIfAborted();
const response = await fetchImpl(`/api/celestrak-satcat/${group}`, {
signal,
});
const text = response.ok ? await response.text() : '';
signal?.throwIfAborted();
// The proxy serves its last copy, marked STALE-ERROR, when CelesTrak
// is down.
const stale = response.headers?.get?.('x-satcat-cache') === 'STALE-ERROR';
return { ok: response.ok, status: response.status, text, stale };
},
/** The UCS Satellite Database pack, keyed by NORAD number. */
readUcs() {
return loadUcs();
},
};
}