packedElementsFromfunction
A source of element sets read from a packed catalogue file (packCatalogue, gzipped or not) at an address you choose: up to 200,000 objects, six-digit catalogue numbers included. The file is asked for once, when the source is added,
and nowhere else: no cookies and no referrer are sent, only https (or http on localhost) is used, a redirect or any answer but 200 is a failed read, and an answer over maxBytes is refused. Nothing is kept between page loads and
nothing is asked on a timer. The package has no address of its own; a site that hosts these files says whose data they are in info.
Import it
import { packedElementsFrom } from "@johnmorrisdotca/chikyu-earth/door";
Definition
function packedElementsFrom(url: string, info: SourceInfo, options?: PackedElementsOptions): ElementRecordSource
Parameters
| Name | Type | Description |
|---|---|---|
url | string | The address of a packed file. |
info | SourceInfo | Who the data is: its id, credit, licence and page. |
options (optional) | PackedElementsOptions |
Returns
ElementRecordSource
The source, for addSource or sources.
Examples
import { packedElementsFrom } from "@johnmorrisdotca/chikyu-earth/door";
const debris = packedElementsFrom("https://example.org/catalogue/debris.pack.gz", {
id: "catalogue-debris",
name: { en: "Debris in Earth orbit", ja: "地球周回軌道のデブリ" },
credit: { en: "Data from Space-Track.org (USSPACECOM)", ja: "データ:Space-Track.org(USSPACECOM)" },
licence: { name: "Space-Track basic SSA data, with citation", url: "https://www.space-track.org/documentation" },
url: "https://www.space-track.org",
retrieved: "2026-11-11",
});
console.log(debris.info.id);