TurbulenceQuery
public struct TurbulenceQuery
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:).
-
Type of the turbulence data whether it’s from the server or own tracked. See
TurbulenceResultTypefor more details.The default is
server.Declaration
Swift
public var type: TurbulenceResultType -
An altitude range to query. Should be round to a thousand feet.
The default is 0…52000. Measured in feet.
Declaration
Swift
public var altRange: ClosedRange<Double>? -
How to provide queried data.
The default is
geoJSON.Declaration
Swift
public var resultOptions: TurbulenceResultOptions -
Aggregate turbulence by the tile to have only one most severe turbulence per tile.
Each hexagon can have multiple reports left for it because multiple flights crossed this hexagon. By default,
TurbulenceQueryhasaggregate = truewhich means you’ll get oneTurbulenceItemper hexagon (tile) with the most severe report for this hexagon.The default is
true.Declaration
Swift
public var aggregate: Bool -
Array of a tile key generated by
Tile.keyorTile.keyByCoord. Use it to query turbulence in the specific tiles.Declaration
Swift
public var tiles: [String]? -
History time to query data for.
When it’s
niltheSkyPath.dataHistoryTimevalue is used. Optional.Declaration
Swift
public var dataHistoryTime: DataHistoryTime? -
Turbulence severities to query.
When it’s
niltheDataQuery.sevswill be used. Optional.Declaration
Swift
public var sevs: [TurbulenceSeverity]? -
Min severity level of turbulence.
Optional. The default is
nil.Declaration
Swift
public var minSev: TurbulenceSeverity? -
A route line coordinates. Should be used in conjunction with
widthAround.When it’s
niltheDataQuery.routewill be used. Typically you don’t need to set it. Optional.Will query for data within the route corridor based on
routeandwidthAround. If it is different fromDataQuery.polygonthere could be no data locally to query.Declaration
Swift
public var route: [CLLocationCoordinate2D]? -
A distance around
routeto build a route corridor.Measured in nautical miles (NM). Optional.
Declaration
Swift
public var widthAround: Double? -
Polygon is a geo-fence area to fetch data inside only.
Should be a closed ring. By default, it uses
DataQuery.polygon. Typically you don’t need to set it. Optional.It is possible to set a custom polygon but the query is made among the locally stored data received by
DataQueryconfiguration. So if the polygons are different there could be no data available locally.Declaration
Swift
public var polygon: [CLLocationCoordinate2D]? -
By default it’s
falseand 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 show high-resolution turbulence polygons on the map instead. In this case, set it to
trueand the query will return aTurbulenceItemarray 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(type: TurbulenceResultType = .server, altRange: ClosedRange<Double>? = nil, resultOptions: TurbulenceResultOptions = .geoJSON, aggregate: Bool = true, tiles: [String]? = nil, dataHistoryTime: DataHistoryTime? = nil)Parameters
typeSee
TurbulenceResultTypefor available options. The default isserver.altRangeWhen it’s
nilall altitudes are used. Measured in feet. Optional.resultOptionsSee
TurbulenceResultOptionsfor available options. The default isgeoJSON.aggregateAggregate reports per tile, taking the highest severity. The default is
true.tilesArray of tile keys generated by
Tile.keyorTile.keyByCoord. Use it to query turbulence in the specific tiles. Optional.dataHistoryTimeHistory time to query data for. When it’s
niltheSkyPath.dataHistoryTimevalue is used. Optional.
TurbulenceQuery Structure Reference