Skip to main content
Version: Next

Live Flights

Overview

A live flight is a flight with the SkyPath app or SDK running on the iPad. When the device records data, the live location is periodically tracked and sent to the server. The live flight report consists of the aircraft details, coordinates, and other data, see LiveFlight SDK API docs for more details.

Setup in DataQuery

By default, the live flight data fetch is disabled. It should be included in the DataQuery.types list:

SkyPath.shared.dataQuery.types = [.turbulence, .liveFlights]

Or using a DataTypeOptions.set(type:enabled:) function :

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

It can be enabled or disabled at any time.

When enabled, live flights will be fetched from the server based on SkyPath.dataUpdateFrequency time interval. Fetched data is not stored on disk and will not be available offline. Only flights that reported location during the last 3 minutes will be fetched and returned by the SDK.

When disabled, live flights will not be fetched from the server and will be removed when expire based on the time-to-expire interval of 3 minutes.

Query

Get live flight data using a query in locally cached memory data without making a server request.

Use LiveFlightQuery to get filtered data as a GeoJSON string or as an array of objects.

It blocks the current thread, so using a separate background thread is recommended.

let query = LiveFlightQuery(
altRange: altRange,
resultOptions: .items,
polygon: corridor)
do {
let result = try SkyPath.shared.liveFlights(with: query).get()
let items = result.items
// Show items on the map
} catch {
print(error)
}