@squawk
    Preparing search index...

    Function computeRouteDistance

    • Computes the total great-circle route distance and optional estimated time enroute for a parsed flight plan route.

      Extracts the ordered sequence of geographic points from the route elements, sums leg distances, and divides by the given ground speed for ETE.

      Elements without coordinates (DCT, speed/altitude groups) are silently skipped. Unresolved tokens are collected in unresolvedElements to indicate which parts of the route could not contribute to the distance calculation.

      Airway segments use the FAA-published distanceToNextNm values when available, falling back to great-circle computation otherwise.

      import { createFlightplanResolver, computeRouteDistance } from '@squawk/flightplan';

      const resolver = createFlightplanResolver({ airports, navaids, fixes, airways });
      const route = resolver.parse('KJFK DCT MERIT J60 MARTN DCT KLAX');
      const result = computeRouteDistance(route, 450);
      console.log(result.totalDistanceNm, result.estimatedTimeEnrouteHrs);

      Parameters

      Returns RouteDistanceResult

      Route distance breakdown with optional ETE.