Skip to main content

Class: AirportUtils

Utility functions for working with airport data.

Constructors

constructor

new AirportUtils(): AirportUtils

Returns

AirportUtils

Methods

getElevation

getElevation(facility): undefined | number

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

NameTypeDescription
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.

Defined in

src/sdk/navigation/AirportUtils.ts:196


getFilteredRunways

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

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

Parameters

NameTypeDescription
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.

Defined in

src/sdk/navigation/AirportUtils.ts:226


getLongestRunway

getLongestRunway(facility): null | AirportRunway

Gets the longest runway of an airport.

Parameters

NameTypeDescription
facilityAirportFacilityThe facility record for the airport.

Returns

null | AirportRunway

The longest runway as an AirportRunway, or null.

Defined in

src/sdk/navigation/AirportUtils.ts:209


hasMatchingRunway

hasMatchingRunway(facility, minLength, surfaceTypes?): boolean

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

NameTypeDescription
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.

Defined in

src/sdk/navigation/AirportUtils.ts:248


tryGetRegionCode

tryGetRegionCode(facility): undefined | string

Attempts to get the region code of an airport.

Parameters

NameTypeDescription
facilityAirportFacilityThe facility record for the airport.

Returns

undefined | string

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

Defined in

src/sdk/navigation/AirportUtils.ts:33