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()
staticfindApproachIndexesFromIdentifier(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
| Parameter | Type | Description |
|---|---|---|
airport | AirportFacility | The 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.designator | string | The designator of the runway. |
identifier.runway.number | string | The number of the runway. |
identifier.suffix | string | The suffix of the approach. |
identifier.type | string | The type name of the approach. |
transitionName | string | The 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()
staticfindDepartureArrivalIndexesFromName(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
| Parameter | Type | Description |
|---|---|---|
procedureArray | readonly Procedure[] | The procedure array in which to search for the procedure. |
procedureName | string | The name of the procedure to find. |
transitionName | string | The name of the procedure enroute transition to find. |
runway | Readonly<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()
staticgetElevation(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
| Parameter | Type | Description |
|---|---|---|
facility | AirportFacility | The 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()
staticgetFilteredRunways(facility,minLength,surfaceTypes?):AirportRunway[]
Defined in: src/sdk/navigation/AirportUtils.ts:231
Get a list of runways at an airport matching specific criteria.
Parameters
| Parameter | Type | Description |
|---|---|---|
facility | AirportFacility | The facility record for the airport. |
minLength | number | The minimum length of the runway, in feet. |
surfaceTypes? | number | An optional bitfield of RunwaySurfaceCategory values to allow. |
Returns
A list of matching runways.
getLongestRunway()
staticgetLongestRunway(facility):null|AirportRunway
Defined in: src/sdk/navigation/AirportUtils.ts:214
Gets the longest runway of an airport.
Parameters
| Parameter | Type | Description |
|---|---|---|
facility | AirportFacility | The facility record for the airport. |
Returns
null | AirportRunway
The longest runway as an AirportRunway, or null.
hasMatchingRunway()
statichasMatchingRunway(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
| Parameter | Type | Description |
|---|---|---|
facility | AirportFacility | The facility record for the airport. |
minLength | number | The minimum length of the runway, in feet. |
surfaceTypes? | number | An optional bitfield of RunwaySurfaceCategory values to allow. |
Returns
boolean
A boolean if a matching runway exists.
tryGetRegionCode()
statictryGetRegionCode(facility):undefined|string
Defined in: src/sdk/navigation/AirportUtils.ts:37
Attempts to get the region code of an airport.
Parameters
| Parameter | Type | Description |
|---|---|---|
facility | AirportFacility | The 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.