Skip to main content

Class: AirportUtils

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

Utility functions for working with airport data.

Constructors​

Constructor​

new AirportUtils(): AirportUtils

Returns​

AirportUtils

Methods​

getElevation()​

static getElevation(facility): undefined | number

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

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.


getFilteredRunways()​

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

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

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:209

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:248

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:33

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.