Skip to main content
Version: Next

ADS-B

Overview

ADS-B - Automatic Dependent Surveillance–Broadcast. ADS-B enables aircraft to broadcast their position, altitude, speed, and other data to ground stations and other aircraft, providing the basis for the next generation of air traffic control.

ADS-B Flow orchestrates the retrieval and management of ADS-B observations data. This page provides a detailed understanding of the flow architecture and how to use it.

ADS-B display on the maps

Startup and Initialization

Upon instantiation, ADS-B Flow sets up initial configurations and prepares the system for data fetching based on provided map polygon and other settings. It immediately subscribes to internal events to handle periodic updates and user-triggered changes.

To crate ADS-B Flow call createAdsbFlow factory method from sdk object.

See example:

// Initialize SDK
const sdk = await createSkyPathSDK(...);

// Create ADS-B Flow
const adsbFlow = sdk.createAdsbFlow()

The createAdsbFlow() method doesn't take any arguments, all configuration for the flow is provided with updateConfig() method.

Lifecycle Management

  • Start: Allocates resources, setting up intervals and listeners for data updates;
  • Update: Triggers an update of the data, fetching new data for relevant areas and settings;
  • Stop: Temporarily stops all operations, keeps resources, and pauses updates / fetches;
  • Terminate: Completely stops all operations, releases resources, and removes all listeners, effectively shutting down the flow;

Data Retrieval Process

Under the hood, ADS-B flow abstracts the complexity for communication with SkyPath platform API in efficient way handling necessary data transformations, mappings and access management:

  • Data fetching: The data for the whole world map is being fetched based on the map polygon and settings set. It handles concurrent loading and ensures that only relevant data is fetched and in performant way;
  • Data Merging: New data may be merged with already loaded areas of a world map, appending it to the stored values to reduce network load and computation time;
  • Data enrichment: Once new data is available on the back-end side, the old data is being enriched with the fresh data;
info

Data update process is triggered automatically by the flow, but can also be triggered manually by the user by calling updateConfig() method.

Automatic updates are triggered periodically every 1 minute.

Once data update is triggered and successfully completed, the flow emits data update event, which can be listened to by the user to update the UI or perform any other necessary actions. This can be done by subscribing to the event using onData method that takes a callback function as an argument and returns ADSBData object for current and previous data:

adsbFlow.onData((data, previousData) => {
// Use the data to update the UI
})

If an error occurs during the update process, the flow emits an error event, which can be listened to by the user to handle the error. This can be done by subscribing to the event using onError method that takes a callback function as an argument and returns an Error object:

adsbFlow.onError((error) => {
// Handle the error
})

Tracking the processing status of the flow can be done by subscribing to the onIsProcessingChange event. This event is emitted when the flow starts or stops processing data. The event returns a boolean value indicating the processing status:

adsbFlow.onIsProcessingChange((isProcessing) => {
// Handle the processing status
})

Configuration

To update the flow with new settings, call updateConfig method:

adsbFlow.updateConfig(config)

The updateConfig(config: Config) method takes the following arguments where the polygon is a custom area on a world map and settings are the configuration for the flow:

PropertyDescriptionTypeDefault
polygonMap viewport rectangle or a route corridor polygonPolygonnull
isCorridorModeFlag to indicate if the polygon is a route corridor or notbooleanfalse
info

Please note, that all properties are optional. If you provide partial configuration, for missing properties previous or default values will be used.

Example: If you first set some polygon and then update the configuration without providing polygon but with isCorridorMode, the previous value for polygon will remain.

You may also erase certain properties by setting them to null if the flow supports it.

undefined values are ignored and will not trigger any changes.

Requirements

We apply some requirements to the polygon size to ensure the performance of the flow. Depending if the polygon is a corridor or not, the flow will handle the polygon differently.

Default Mode

When dealing with default mode, meaning isCorridorMode is false, flow relates polygon to 1 of 3 sizes:

  • Small: smaller than continental U.S.
  • Medium: from small to large
  • Large: larger than the 2x continental U.S.

For each size, the flow applies different handling strategies to ensure the performance of the flow.

  • All severity data is loaded.
  • Full polygon is loaded.

handlingSmallPolygonAdsb

Corridor Mode

When dealing with corridor mode, meaning isCorridorMode is true, there are only one limitation - the polygon size should be less than 2,500,000 nautical miles, otherwise, the flow will not load the data and will emit an error.

  • Smooth severity data is excluded.
  • Corridor polygon is loaded.

corridorPolygon

Examples

Basic usage

// Import the SDK 
import createSkyPathSDK from "@yamasee/skypath-sdk-web";

// Init with your credentials
const sdk = await createSkyPathSDK(...);

// Create ADS-B Flow
const adsbFlow = sdk.createAdsbFlow()

// Subscribe to the data update event
adsbFlow.onData((data) => {
// Use the data to update the UI
})

// Subscribe to the error event
adsbFlow.onError((error) => {
// Handle the error
})

// Start the flow when needed
adsbFlow.start()

// Later in the code update the configuration
adsbFlow.updateConfig({
polygon: [
[ -64.816, -18.751 ],
[ -64.816, -28.452 ],
[ -51.672, -28.452 ],
[ -51.672, -18.751 ],
[ -64.816, -18.751 ]
],
})

// Later in the code terminate the flow when jobs are done
adsbFlow.terminate()

Advanced usage

For advanced examples check the React Demo Application.