Class: IntersectionFacilityUtils
Defined in: src/sdk/navigation/FacilityUtils.ts:118
Utility functions for working with intersection facilities.
Constructors
Constructor
new IntersectionFacilityUtils():
IntersectionFacilityUtils
Returns
IntersectionFacilityUtils
Methods
filterDuplicates()
Call Signature
staticfilterDuplicates(icaos,retainTerminal?):IcaoValue[]
Defined in: src/sdk/navigation/FacilityUtils.ts:221
Filters an array of ICAOs such that the filtered array does not contain any duplicate terminal/non-terminal intersection pairs. All non-intersection ICAOs are guaranteed to be retained in the filtered array.
Parameters
| Parameter | Type | Description |
|---|---|---|
icaos | readonly IcaoValue[] | The array to filter. |
retainTerminal? | boolean | Whether to retain the terminal version of a duplicate pair in the filtered array. If true, each non-terminal intersection in the array will be filtered out if and only if the array contains at least one of its terminal intersection counterparts. If false, each terminal intersection in the array will be filtered out if and only if the array contains its non-terminal intersection counterpart. Defaults to false. |
Returns
A copy of the original array with no duplicate terminal/non-terminal intersection pairs.
Call Signature
staticfilterDuplicates(facilities,retainTerminal?):Facility[]
Defined in: src/sdk/navigation/FacilityUtils.ts:232
Filters an array of facilities such that the filtered array does not contain any duplicate terminal/non-terminal intersection pairs. All non-intersection facilities are guaranteed to be retained in the filtered array.
Parameters
| Parameter | Type | Description |
|---|---|---|
facilities | readonly Facility[] | The array to filter. |
retainTerminal? | boolean | Whether to retain the terminal version of a duplicate pair in the filtered array. If true, each non-terminal intersection in the array will be filtered out if and only if the array contains at least one of its terminal intersection counterparts. If false, each terminal intersection in the array will be filtered out if and only if the array contains its non-terminal intersection counterpart. Defaults to false. |
Returns
Facility[]
A copy of the original array with no duplicate terminal/non-terminal intersection pairs.
Call Signature
staticfilterDuplicates<T>(array,getIcao,retainTerminal?):T[]
Defined in: src/sdk/navigation/FacilityUtils.ts:246
Filters an array of arbitrary elements such that the filtered array does not contain any elements that are mapped to duplicate terminal/non-terminal intersection pairs. All elements that are not mapped to intersections are guaranteed to be retained in the filtered array.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
array | readonly T[] | The array to filter. |
getIcao | (element) => IcaoValue | A function which maps array elements to ICAOs. |
retainTerminal? | boolean | Whether to retain the terminal version of a duplicate pair in the filtered array. If true, each non-terminal intersection in the array will be filtered out if and only if the array contains at least one of its terminal intersection counterparts. If false, each terminal intersection in the array will be filtered out if and only if the array contains its non-terminal intersection counterpart. Defaults to false. |
Returns
T[]
A copy of the original array with no elements that are mapped to duplicate terminal/non-terminal intersection pairs.
getNonTerminalICAO()
staticgetNonTerminalICAO(icao):string
Defined in: src/sdk/navigation/FacilityUtils.ts:183
Gets the non-terminal version of an intersection ICAO string (V1). If the ICAO is already a non-terminal intersection ICAO, then an identical ICAO will be returned.
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | An intersection ICAO. |
Returns
string
The non-terminal version of the specified intersection ICAO.
Throws
Error if the specified ICAO is not an intersection ICAO.
Deprecated
Please use getNonTerminalIcaoValue() instead.
getNonTerminalIcaoValue()
staticgetNonTerminalIcaoValue(icao):IcaoValue
Defined in: src/sdk/navigation/FacilityUtils.ts:163
Gets the non-terminal version of an intersection ICAO value. If the ICAO is already a non-terminal intersection ICAO, then an identical ICAO will be returned.
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | IcaoValue | An intersection ICAO. |
Returns
The non-terminal version of the specified intersection ICAO.
Throws
Error if the specified ICAO is not an intersection ICAO.
isTerminal()
Call Signature
staticisTerminal(icao):boolean
Defined in: src/sdk/navigation/FacilityUtils.ts:127
Checks whether an intersection ICAO belongs to a terminal intersection.
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | IcaoValue | The ICAO to check. |
Returns
boolean
Whether the specified intersection ICAO belongs to a terminal intersection.
Throws
Error if the specified ICAO is not an intersection ICAO.
Call Signature
staticisTerminal(icao):boolean
Defined in: src/sdk/navigation/FacilityUtils.ts:135
Checks whether an intersection ICAO belongs to a terminal intersection.
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | The ICAO to check. |
Returns
boolean
Whether the specified intersection ICAO belongs to a terminal intersection.
Throws
Error if the specified ICAO is not an intersection ICAO.
Deprecated
Please use the signature that takes an IcaoValue instead.
Call Signature
staticisTerminal(facility):boolean
Defined in: src/sdk/navigation/FacilityUtils.ts:142
Checks whether an intersection facility is a terminal intersection.
Parameters
| Parameter | Type | Description |
|---|---|---|
facility | IntersectionFacility | The intersection facility to check. |
Returns
boolean
Whether the specified intersection facility is a terminal intersection.
Throws
Error if the specified facility is not an intersection.