@squawk
    Preparing search index...

    Interface AirspaceResolver

    Stateless resolver exposing airspace query methods.

    interface AirspaceResolver {
        byAirport(
            identifier: string,
            types?: ReadonlySet<AirspaceType>,
        ): AirspaceFeature[];
        byArtcc(identifier: string, stratum?: ArtccStratum): AirspaceFeature[];
        byCentroid(query: AirspaceCentroidQuery): AirspaceFeature[];
        byIdentifier(
            identifier: string,
            options?: AirspaceByIdentifierOptions,
        ): AirspaceFeature[];
        forEachIndexed(
            callback: (
                feature: AirspaceFeature,
                ring: readonly number[][],
                boundingBox: polygon.BoundingBox,
            ) => void,
        ): void;
        query(query: AirspaceQuery): AirspaceFeature[];
        withinBbox(bbox: polygon.BoundingBox): AirspaceFeature[];
    }
    Index

    Methods

    • Returns every airspace feature associated with the given identifier, independent of position or altitude. Lookup is case-insensitive.

      For Class B/C/D/E2 airspace, the feature identifier is the associated airport's FAA location identifier (e.g. "JFK" for the NY Class B). For Special Use Airspace, it is the NASR designator (e.g. "R-2508"). Pass only the bare identifier - ICAO-prefixed codes like "KJFK" will not match; resolve to an FAA ID first via @squawk/airports if needed.

      Note: ARTCC features share the identifier-keyed index but are typically looked up via byArtcc for clearer ergonomics. ARTCC features are excluded from byAirport results since their identifier is a center code (e.g. "ZNY"), not an airport identifier.

      Parameters

      • identifier: string

        FAA identifier or NASR designator.

      • Optionaltypes: ReadonlySet<AirspaceType>

        Optional type filter. Only features whose type is in this set are returned. When omitted, all non-ARTCC types are returned.

      Returns AirspaceFeature[]

      All features whose identifier matches, or an empty array.

    • Returns every ARTCC feature associated with the given center identifier, independent of position or altitude. Lookup is case-insensitive.

      Each US ARTCC is published as multiple features - one per stratum (LOW, HIGH, UTA, CTA, FIR, CTA/FIR) - because the lateral extent can vary between strata. Pass an optional stratum filter to narrow results to a single stratum.

      Parameters

      • identifier: string

        Three-letter ARTCC code (e.g. "ZNY", "ZBW").

      • Optionalstratum: ArtccStratum

        Optional stratum filter. When provided, only features whose artccStratum matches are returned.

      Returns AirspaceFeature[]

      All matching ARTCC features, or an empty array.

    • Returns every airspace feature whose polygon centroid lies within the given tolerance of the query coordinates. Useful for resolving features that have an empty identifier (some Class E5 surfaces) and therefore have no stable identifier-keyed lookup - the polygon centroid is the fallback handle.

      Reach for this when you have a centroid encoded into a URL or other external string and want to recover the original feature(s); for identifier-keyed lookups, prefer byIdentifier (or the more specific byAirport / byArtcc). Centroid is computed per call - no internal caching - so this is O(n) over the indexed corpus, suitable for occasional URL-driven lookups but not for tight loops.

      Parameters

      Returns AirspaceFeature[]

      All features whose centroid is within tolerance, in dataset order.

    • Returns every airspace feature for the given identifier across both the ARTCC and non-ARTCC partitions, independent of position or altitude. Lookup is case-insensitive.

      Reach for this when you have an identifier whose airspace type is not known up-front (e.g. parsed from a URL) and you want a single call that returns the matching feature(s) regardless of partition. For ergonomic shortcuts when the partition is known, prefer byAirport (returns non-ARTCC features only) or byArtcc (returns ARTCC features only) - those wrappers encode the common "shells for this airport" / "stratums for this center" questions and stay available alongside this type-agnostic form.

      Parameters

      Returns AirspaceFeature[]

      All matching features, or an empty array.

    • Iterates the indexed corpus in dataset order, invoking callback once per feature with the parsed feature, its exterior ring, and its pre-computed bounding box. Exposes the resolver's pre-parsed shape so callers that need to filter the corpus themselves do not have to reparse the source GeoJSON or recompute geometry per call.

      The ring and boundingBox arguments are the resolver's internal caches and must not be mutated by the callback - copy them first if a mutation is needed.

      Parameters

      • callback: (
            feature: AirspaceFeature,
            ring: readonly number[][],
            boundingBox: polygon.BoundingBox,
        ) => void

        Function invoked once per indexed feature.

      Returns void

    • Returns every airspace feature whose lateral polygon contains the given position and whose vertical bounds contain the given altitude.

      Parameters

      • query: AirspaceQuery

        Position, altitude, and optional type filter.

      Returns AirspaceFeature[]

      All matching features, in no particular order.

    • Returns every airspace feature whose pre-indexed bounding box overlaps the given bounding box. Reuses the bounding box computed once at resolver creation time rather than recomputing per call, so this is suitable for tight loops over the corpus (e.g. a chip rebuild against a selection footprint).

      Bounding-box overlap is a coarse spatial filter: it matches any feature whose axis-aligned rectangle intersects the query rectangle, including features whose actual polygon does not. Callers that need true polygon-polygon intersection should follow up with their own geometry test on the returned features.

      Parameters

      Returns AirspaceFeature[]

      All features whose pre-indexed bounding box overlaps, in dataset order.