Class: IntersectionFacilityUtils
Utility functions for working with intersection facilities.
Constructors
constructor
• new IntersectionFacilityUtils(): IntersectionFacilityUtils
Returns
Methods
filterDuplicates
▸ filterDuplicates(icaos
, retainTerminal?
): string
[]
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
Name | Type | Description |
---|---|---|
icaos | readonly string [] | 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
string
[]
A copy of the original array with no duplicate terminal/non-terminal intersection pairs.
Defined in
src/sdk/navigation/Facilities.ts:1531
▸ filterDuplicates(facilities
, retainTerminal?
): Facility
[]
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
Name | Type | Description |
---|---|---|
facilities | readonly Facility [] | - |
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.
Defined in
src/sdk/navigation/Facilities.ts:1542
▸ filterDuplicates<T
>(array
, getIcao
, retainTerminal?
): T
[]
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
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
array | readonly T [] | - |
getIcao | (element : T ) => string | 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.
Defined in
src/sdk/navigation/Facilities.ts:1556
getNonTerminalICAO
▸ getNonTerminalICAO(icao
): string
Gets the non-terminal version of an intersection ICAO. If the ICAO is already a non-terminal intersection ICAO, then an identical string will be returned.
Parameters
Name | 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.
Defined in
src/sdk/navigation/Facilities.ts:1493
isTerminal
▸ isTerminal(icao
): boolean
Checks whether an intersection ICAO belongs to a terminal intersection.
Parameters
Name | Type |
---|---|
icao | string |
Returns
boolean
Whether the specified intersection ICAO belongs to a terminal intersection.
Throws
Error if the specified ICAO is not an intersection ICAO.
Defined in
src/sdk/navigation/Facilities.ts:1468
▸ isTerminal(facility
): boolean
Checks whether an intersection facility is a terminal intersection.
Parameters
Name | Type |
---|---|
facility | IntersectionFacility |
Returns
boolean
Whether the specified intersection facility is a terminal intersection.
Throws
Error if the specified facility is not an intersection.
Defined in
src/sdk/navigation/Facilities.ts:1474