Structures

The following structures are available globally.

  • Use TurbulencePolygonsQuery to get filtered data as a GeoJSON string. It will query locally cached data received previously. Used in SkyPath.turbulencePolygons(with:).

    See more

    Declaration

    Swift

    public struct TurbulencePolygonsQuery
  • A result of query turbulence polygons using TurbulencePolygonsQuery. Specified in TurbulencePolygonsQuery.resultOptions.

    See more

    Declaration

    Swift

    public struct TurbulencePolygonsResult
  • Controls how to receive a queried turbulence result using TurbulencePolygonsQuery.

    See more

    Declaration

    Swift

    public struct TurbulencePolygonsResultOptions : OptionSet
  • Use TurbulenceQuery to get filtered data as an array of TurbulenceItem objects or a GeoJSON string. It will query locally cached data received previously. Used in SkyPath.turbulence(with:).

    See more

    Declaration

    Swift

    public struct TurbulenceQuery
  • A result of query turbulence using TurbulenceQuery. Specified in TurbulenceQuery.resultOptions.

    See more

    Declaration

    Swift

    public struct TurbulenceResult
  • Controls how to receive a queried turbulence result using TurbulenceQuery.

    See more

    Declaration

    Swift

    public struct TurbulenceResultOptions : OptionSet
  • A supported by SkyPath aircraft data.

    See more

    Declaration

    Swift

    public struct Aircraft : Codable, Equatable
  • Control how to search alerts. By default, it uses the current location and beam mode with default values. When passing route the search will be done in coordinates instead. By default, the current location altitude will be used to make a range with +/- 2k feet. Set altRange when you need the custom range to search for alerts.

    See more

    Declaration

    Swift

    public struct AlertQuery
  • Result object with found alerts based on AlertQuery configuration. It will always have at least one item in the turbulence array.

    See more

    Declaration

    Swift

    public struct AlertResult : Equatable
  • At first request, the whole data according to SkyPath.dataQuery is fetched and then only the new data that appeared (delta) is fetched to save network traffic. When cached data expires or a delta can’t be received, the whole fresh data will be received again.

    There are thousands of turbulence reports around the globe. To reduce network traffic usage and keep only data that is currently needed the data fetch is separated into the different types controlled by the SkyPath.dataQuery object that is set initially to default values and can be updated at any time. All of the below are optional to set but recommended due to your specific flow.

    After updating SkyPath.dataQuery in any way, the check, if need to fetch new data, will be made. And if the change requires a new server fetch, the server request will be made immediately. No need to call SkyPath.fetchData(refresh:).

    You can update data query at any time and in both ways by setting a property only or a whole object.

    SkyPath.shared.dataQuery.polygon = polygon
    SkyPath.shared.dataQuery = DataQuery(polygon: polygon)
    
    See more

    Declaration

    Swift

    public struct DataQuery
  • SkyPath data types available to be fetched from the server. Only specified type in DataQuery.types will be fetched and stored locally.

    See more

    Declaration

    Swift

    public struct DataTypeOptions : OptionSet, Hashable
  • Tracked data is aggregated and anonymized. To group tracked data it’s attached to a corresponding flight. The set flight object is stored locally until removed.

    See more

    Declaration

    Swift

    public struct Flight : Codable
  • A location object that encapsulates system-provided location and internally calculated values.

    While data fetching from the server does not depend much on the location, it is important to have a good location to track turbulence data. Cellular devices have a built-in GPS and can have a stable location without an internet connection, but WiFi-only devices do not and need an internet connection or an external GPS receiver. When a device has poor location data (outdated or invalid) SDK will not track data and show the current position on the map. However, SDK tries to operate with a poor or shaky GPS signal as much as possible. SDK handles all location-related stuff out of the box.

    SkyPathDelegate.locationManagerDidFail(withError:) could be called when SDK failed to get a location when, for example, a GPS signal is not available, or location usage permission has not been granted for the app.

    Low power mode. SDK tracks the best accuracy location when in flight to correctly track turbulence data. When the location is not needed anymore (when landed) and SDK was not stopped (when the app is left in the background or foreground), SDK can stop location tracking and switch to low power mode to save battery. Location tracking will start for the next flight.

    SkyPathDelegate.didUpdateLowPowerMode(_:) notifies that SDK updated the low power mode state. A method is optional. You can use it to notify that location tracking stopped or just do nothing and ignore it.

    See more

    Declaration

    Swift

    public struct SPLocation : Codable
  • The Tile is a representation of a turbulence report’s H3 index area within a corresponding altitude box.

    SkyPath divides the world into 10x10 miles x 1000 feet high logical rectangular boxes, which were found to be the best balance; not to overload the pilots with information, but give enough granularity for the pilots to be able to take action and avoid CAT consequences. SkyPath uses H3 hexagonal hierarchical geospatial indexing system with H3 resolution 5 to represent turbulence area by hexagons of different severity levels. SDK handles all work with H3 indexes out of the box so you don’t need to do anything for it on your side.

    See more

    Declaration

    Swift

    public struct Tile : Codable, Equatable, Hashable
  • The turbulence data object.

    See more

    Declaration

    Swift

    public struct TurbulenceItem : Codable, Equatable