astro.codex region lookup - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / astro/codex-region-lookup
Resolve a coordinate or system address to its Elite Dangerous galactic codex region.
The region a system belongs to is fixed by its position on a flat ≈49.35 ly
(4096 / 83 ly) grid over the galactic plane. Each region's cells are stored as
run-length geometry in data/astro/galactic-region-cells.jsonc (kept separate
from the lightweight metadata so metadata-only consumers never bundle it); this
module rebuilds a per-row lookup index from them. The per-region metadata objects
live in ./codex-region.
Two lookups are provided, matching the two things the game calls "the region":
- findCodexRegionAt — the region at a set of coordinates (what the codex records a discovery against, and what is shown when jumping into a system).
-
findCodexRegionForBoxel — the region of a system's boxel
0/0/0corner (what the journal and the codex main page display for the system).
These can differ near a region border; see the upstream discussion linked in the data file's attribution.
Algorithm ported from klightspeed's EliteDangerousRegionMap (RegionMap.js).
See ATTRIBUTIONS.md for credit and licence terms.
Re-exports SystemAddressInput