AlertQuery

public struct AlertQuery

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.

  • Min severity level of turbulence to alert.

    Optional. The default is nil.

    Declaration

    Swift

    public var minSev: TurbulenceSeverity?
  • Severity levels of turbulence. Will use only turbulence with these severities if set.

    Optional. The default is nil.

    Declaration

    Swift

    public var sevs: [TurbulenceSeverity]?
  • Distance of “beam” or route if set.

    Measured in nautical miles (NM). The default is 100 NM.

    Declaration

    Swift

    public var distance: Double
  • Time frame from now in which search for turbulence. distance will be ignored.

    Distance will be dynamically calculated from the current speed and this time set. If speed is not currently available, the distance will be used. Measured in seconds.

    Optional. The default is nil.

    Declaration

    Swift

    public var timeFrame: TimeInterval?
  • Angle in degrees from velocity vector.

    The default is 15 degrees.

    Declaration

    Swift

    public var angleSpan: Double
  • Altitude lower and upper bounds of the range. Should be round to a thousand feet.

    If set, the turbulence will be searched inside this altitude range only despite the current location altitude.

    Measured in feet.

    Declaration

    Swift

    public var altRange: ClosedRange<Double>?
  • If the aircraft is far from this value from the nearest coordinate of a route (if set), then switch to beam mode searching alerts.

    The default is 20 NM. Measured in nautical miles (NM).

    Declaration

    Swift

    public var switchToBeamOnDistanceFromRoute: Double
  • Do not alert on your own recorded turbulence for the last time span.

    Measured in minutes. The default is 60.

    Declaration

    Swift

    public var excludeOwnTimeSpan: Int
  • Coordinates of the route line. widthAround will be used for a route corridor.

    Declaration

    Swift

    public var route: [CLLocationCoordinate2D]?
  • Distance from the route line coordinates to search for alerts.

    Measured in NM. The default is 20 NM.

    Declaration

    Swift

    public var widthAround: Double?
  • Polygon coordinates to get turbulence alerts inside it only.

    The last coordinate should be the same as the first to have a closed polygon.

    Declaration

    Swift

    public var polygon: [CLLocationCoordinate2D]?
  • Array of tile keys. Use it to query turbulence in specific tiles.

    Declaration

    Swift

    public var tiles: [String]?
  • History time of queried data. When it’s nil the SkyPath.dataHistoryTime value is used.

    Optional. The default is nil.

    Declaration

    Swift

    public var dataHistoryTime: DataHistoryTime?
  • By default it’s false and only route corridor and viewport low-resolution H3 turbulence reports will be queried.

    But when offline and no low-resolution turbulence reports are cached it could be useful to use high-resolution turbulence polygons to search for alerts instead. In this case, set it to true and the query will return a TurbulenceItem array generated from turbulence polygons cached for the specified area.

    It will use polygons data only if no low-resolution H3 turbulence reports meet the query. A recommendation for when to use it is when the app is offline.

    Optional. By default, it is false.

    Declaration

    Swift

    public var usePolygonsEnabled: Bool
  • Default initializer.

    Declaration

    Swift

    public init(minSev: TurbulenceSeverity? = nil,
                sevs: [TurbulenceSeverity]? = nil,
                distance: Double = 100,
                timeFrame: TimeInterval? = nil,
                angleSpan: Double = 15,
                altRange: ClosedRange<Double>? = nil,
                route: [CLLocationCoordinate2D]? = nil,
                widthAround: Double? = 20,
                switchToBeamOnDistanceFromRoute: Double = 20,
                excludeOwnTimeSpan: Int = 60,
                dataHistoryTime: DataHistoryTime? = nil)

    Parameters

    minSev

    Min severity level of turbulence to alert. Optional. The default is nil.

    sevs

    Severity levels of turbulence. Will use only turbulence with these severities if set. Optional. The default is nil.

    distance

    Distance of “beam” or route if set. Measured in nautical miles (NM). The default is 100 NM.

    timeFrame

    Time frame from now in which search for turbulence. distance will be ignored. Distance will be dynamically calculated from the current speed and this time set. If speed is not currently available, the distance will be used. Measured in seconds. Optional. The default is nil.

    angleSpan

    Angle of a “beam”. Measured in degrees.

    altRange

    Altitude range. Optional. Measured in feet.

    route

    Coordinates of the route line. widthAround will be used for a route corridor.

    widthAround

    Distance from the route line coordinates to search for alerts. Measured in NM. The default is 20 NM.

    switchToBeamOnDistanceFromRoute

    When to switch to beam mode. Optional. Measured in nautical miles (NM).

    excludeOwnTimeSpan

    Do not alert on your own recorded turbulence for the last time span. Measured in minutes. The default is 60.

    dataHistoryTime

    History time of queried data. When it’s nil the SkyPath.dataHistoryTime value is used. Optional. The default is nil.