Skip to main content
Version: 3.0

Observations

Overview

Observations are Observed Turbulence reports left from recording devices with SkyPath.

ObservationsObservations

Setup

By default, the observations data fetch is enabled in the DataQuery.types. You can change it at any time.

SkyPath.shared.dataQuery.types.set(type: .turbulence, enabled: true)

When enabled, observations will be fetched from the server every minute. Fetched data will be stored on disk and will be available offline.

Observations data will be fetched for areas set in DataQuery.polygon and DataQuery.viewport, similar to other data fetch flows.

The SkyPathDelegate.didReceiveNewTurbulenceData(areaType:) delegate function will be called when the SDK has fetched new observations data from the server.

Query

See Query Data for the general query data approach details.

To query Observations you will need:

  • TurbulenceQuery for a configuration
  • SkyPath.turbulence(with:) function to query the data
  • TurbulenceItem to process the result items

Example of how to query the observed turbulence data:

do {
let result = try SkyPath.shared.turbulence(with: TurbulenceQuery()).get()
let geoJSON = result.geoJSON
// Show GeoJSON on the map
} catch {
print(error)
}