Skip to main content

Class: AirportUtils

Defined in: src/sdk/navigation/AirportUtils.ts:11

Utility functions for working with airport data.

Constructors

Constructor

new AirportUtils(): AirportUtils

Returns

AirportUtils

Methods

findApproachIndexesFromIdentifier()

static findApproachIndexesFromIdentifier(airport, identifier, transitionName): object

Defined in: src/sdk/navigation/AirportUtils.ts:345

Finds the index of an approach in an airport facility described by an approach identifier and the index of a named transition in the approach's transition array.

Parameters

ParameterTypeDescription
airportAirportFacilityThe airport facility in which to search for the approach.
identifier{ __Type: "JS_ApproachIdentifier"; runway: { __Type: "JS_RunwayIdentifier"; designator: string; number: string; }; suffix: string; type: string; }The identifier for the approach to find.
identifier.__Type"JS_ApproachIdentifier"Coherent C++ object binding type.
identifier.runway{ __Type: "JS_RunwayIdentifier"; designator: string; number: string; }The approach's associated runway.
identifier.runway.__Type"JS_RunwayIdentifier"Coherent C++ object binding type.
identifier.runway.designatorstringThe designator of the runway.
identifier.runway.numberstringThe number of the runway.
identifier.suffixstringThe suffix of the approach.
identifier.typestringThe type name of the approach.
transitionNamestringThe name of the approach transition to find.

Returns

The indexes of the specified approach in the airport facility's approach array and of the specified transition in the approach's transition array.

approachIndex

approachIndex: number

The index of the approach, or -1 if no approach could be found.

transitionIndex

transitionIndex: number

The index of the approach transition, or -1 if no transition could be found.


findDepartureArrivalIndexesFromName()

static findDepartureArrivalIndexesFromName(procedureArray, procedureName, transitionName, runway): object

Defined in: src/sdk/navigation/AirportUtils.ts:278

Finds the index of a named departure or arrival procedure in an airport facility procedure array, the index of a named enroute transition in the procedure's enroute transition array, and the index of a runway transition in the procedure's runway transition array for a given runway.

Parameters

ParameterTypeDescription
procedureArrayreadonly Procedure[]The procedure array in which to search for the procedure.
procedureNamestringThe name of the procedure to find.
transitionNamestringThe name of the procedure enroute transition to find.
runwayReadonly<RunwayIdentifier>The identifier for the runway associated with the procedure runway transition to find.

Returns

The indexes of the specified departure or arrival procedure in the specified procedure array, of the specified enroute transition in the procedure's enroute transition array, and of the specified runway transition in the procedure's runway transition array.

enrouteTransitionIndex

enrouteTransitionIndex: number

The index of the enroute transition, or -1 if no enroute transition could be found.

procedureIndex

procedureIndex: number

The index of the procedure, or -1 if no procedure could be found.

runwayTransitionIndex

runwayTransitionIndex: number

The index of the runway transition, or -1 if no runway transition could be found.


getElevation()

static getElevation(facility): undefined | number

Defined in: src/sdk/navigation/AirportUtils.ts:201

Gets the elevation of an airport, in meters. The elevation is estimated as the average elevation of the airport's runways. If the airport has no runways, an elevation cannot be estimated and undefined is returned instead.

Parameters

ParameterTypeDescription
facilityAirportFacilityThe facility record for the airport.

Returns

undefined | number

The elevation of the specified airport, in meters, or undefined if the elevation could not be determined.

Deprecated

Please use the altitude property on AirportFacility instead to retrieve the airport's elevation.


getFilteredRunways()

static getFilteredRunways(facility, minLength, surfaceTypes?): AirportRunway[]

Defined in: src/sdk/navigation/AirportUtils.ts:231

Get a list of runways at an airport matching specific criteria.

Parameters

ParameterTypeDescription
facilityAirportFacilityThe facility record for the airport.
minLengthnumberThe minimum length of the runway, in feet.
surfaceTypes?numberAn optional bitfield of RunwaySurfaceCategory values to allow.

Returns

AirportRunway[]

A list of matching runways.


getLongestRunway()

static getLongestRunway(facility): null | AirportRunway

Defined in: src/sdk/navigation/AirportUtils.ts:214

Gets the longest runway of an airport.

Parameters

ParameterTypeDescription
facilityAirportFacilityThe facility record for the airport.

Returns

null | AirportRunway

The longest runway as an AirportRunway, or null.


hasMatchingRunway()

static hasMatchingRunway(facility, minLength, surfaceTypes?): boolean

Defined in: src/sdk/navigation/AirportUtils.ts:253

Checks to see whether an airport has a runway matching specific criteria. This is a lighter version of getFilteredRunways that doesn't do any extra assignments.

Parameters

ParameterTypeDescription
facilityAirportFacilityThe facility record for the airport.
minLengthnumberThe minimum length of the runway, in feet.
surfaceTypes?numberAn optional bitfield of RunwaySurfaceCategory values to allow.

Returns

boolean

A boolean if a matching runway exists.


tryGetRegionCode()

static tryGetRegionCode(facility): undefined | string

Defined in: src/sdk/navigation/AirportUtils.ts:37

Attempts to get the region code of an airport.

Parameters

ParameterTypeDescription
facilityAirportFacilityThe facility record for the airport.

Returns

undefined | string

The region code of an airport, or undefined if one could not be found.

Deprecated

Please use the region property on AirportFacility instead to retrieve the airport's region code.