Array
extension Array where Element == CLLocationCoordinate2D
public extension Array where Element == LiveFlight
public extension Array where Element == NowcastItem
public extension Array where Element == TurbulenceItem
-
Generates a geodesic polyline coordinates using
MapKit.MKGeodesicPolyline.When a line crosses Antimerdian it will have longitude from both sides, like +179° and -179°. This leads to a drawing over the whole globe.
The result coordinates will be normalized into [-360°,0°] or [0°, +360°] longitude range. Warning. Longitude below -180° or above +180° is not a valid coordinate so the map library or parser could throw an error.
Declaration
Swift
public var geodesic: [CLLocationCoordinate2D] { get } -
Generates a corridor polygon.
Declaration
Swift
public func buffer(widthNM: Double, simplify: Bool = true, tolerance: Double = 0.1) -> [CLLocationCoordinate2D]Parameters
widthNMThe width of corridor in nautical miles.
simplifyIf the polygon should be simplified.
trueby default.toleranceControls the level of simplification by specifying the maximum allowed distance between the original line point and the simplified point. A higher tolerance value results in higher simplification.
0.1is good for server fetch and0.01is good for drawing on the map. The default is0.1. -
Simplifies the polygon.
Declaration
Swift
public func simplify(tolerance: Double = 0.1) -> [CLLocationCoordinate2D]Parameters
toleranceControls the level of simplification by specifying the maximum allowed distance between the original line point and the simplified point. A higher tolerance value results in higher simplification. The default is 0.1.
-
Finds an intersection between two polygons.
Declaration
Swift
public func intersection(with polygon: [CLLocationCoordinate2D]) -> [CLLocationCoordinate2D]?Parameters
polygonThe polygon to check intersection with.
-
Smooth the polygon using the Ramer–Douglas–Peucker algorithm.
Performed on the caller queue and when lot of coordinates it could take some time, so using a background queue is recommended.
Declaration
Swift
public func smoothed(iterations: Int = 1) -> [CLLocationCoordinate2D]Parameters
iterationsControls the level of smoothness. A higher number results in higher smoothness. The default is 1.
-
Converts the array of
LiveFlightto a valid GeoJSON that can be visualized on the map.Can be used when you have a custom filtering of
LiveFlightbut need a GeoJSON for the map.Declaration
Swift
func geoJSON() -> String
-
Converts the array of
NowcastItemto a valid GeoJSON that can be visualized on the map.Declaration
Swift
func geoJSON() -> String
-
Converts the array of
TurbulenceItemto a valid GeoJSON that can be visualized on the map.Can be used when you have a custom filtering of
TurbulenceItembut need a GeoJSON for the map.Declaration
Swift
func geoJSON(withType type: TurbulenceResultType) -> StringParameters
typeThe feature geometry of turbulence in GeoJSON can be different for own (circle) and server (hexagon) turbulence.
Array Extension Reference