@squawk
    Preparing search index...

    Function extractLegPoints

    • Extracts the ordered sequence of drawable geographic points from an expanded procedure leg sequence (the legs array of a ProcedureExpansionResult).

      Only legs that terminate at a known fix contribute a point: a leg is drawable when it carries a fixIdentifier, lat, and lon. Legs whose path terminator ends at an altitude, DME distance, radial, intercept, or manual event (CA, FA, VA, CD, FD, VD, CR, VR, CI, VI, FM, VM, and the HA / HM holds) have no coordinate and are skipped. Because a skipped leg leaves a gap, the returned points are not guaranteed to be contiguous: a non-positional leg in the middle of a sequence creates a break in any line drawn through the points, and such legs cannot be rendered from this data alone (they need a flyable geometry computed from the aircraft state, navaid, or altitude).

      Consecutive duplicate points (within a small epsilon) are suppressed, so a hold or fix repeated back-to-back yields a single point.

      import { createProcedureResolver, extractLegPoints } from '@squawk/procedures';

      const resolver = createProcedureResolver({ data: procedures });
      const expansion = resolver.expand('KDEN', 'AALLE4');
      const points = expansion ? extractLegPoints(expansion.legs) : [];

      Parameters

      • legs: ProcedureLeg[]

        Ordered procedure legs, e.g. expand(...).legs.

      Returns ProcedureLegPoint[]

      Ordered drawable points along the procedure.