astro.Function.findHandAuthoredRegionAt - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / astro / findHandAuthoredRegionAt

Function: findHandAuthoredRegionAt()

findHandAuthoredRegionAt(position): HandAuthoredRegion | null

Defined in: src/astro/hand-authored-regions.ts:126

The hand-authored region containing a galactic point, or null for procedural space.

Because HAND_AUTHORED_REGIONS is sorted smallest-radius-first, the first region whose sphere set contains the point is the most specific one — matching the game's overlap priority.

Parameters

position

GalacticPosition

Galactic position in light-years (Sol at origin). All three axes are used — hand-authored regions are 3-D spheres, so y matters here (unlike the flat findCodexRegionAt). A ProceduralSystem.position value can be passed directly.

Returns

HandAuthoredRegion | null

The containing region, or null if the point is in procedural space.

Remarks

This resolves a hand-authored named sector only. For the codex region a point falls in, use findCodexRegionAt from ./codex-region-lookup instead.

Examples

import { findHandAuthoredRegionAt } from '@elite-dangerous-almanac/core/astro/hand-authored-regions';

findHandAuthoredRegionAt({ x: -80.6, y: -146.7, z: -343.3 })?.name;
// -> 'Pleiades Sector'

Resolving a permit lock from a position — the exact route, since it does not depend on how the system is named:

import type { GalacticPosition } from '@elite-dangerous-almanac/core/astro';
import { findHandAuthoredRegionAt } from '@elite-dangerous-almanac/core/astro/hand-authored-regions';

declare const position: GalacticPosition;

import { isPermitLockedRegionName } from '@elite-dangerous-almanac/core/astro/permit-locked-regions';

const region = findHandAuthoredRegionAt(position);
const needsPermit = region !== null && isPermitLockedRegionName(region.name);
⚠️ **GitHub.com Fallback** ⚠️