Skip to main content
Version: 1.0.x

Type Definitions

General Types​

HexId​

The HexId is a string that represents the H3 hexagon id of resolution 0 or 1.

HexId type definition
type HexId = string;
HexId example
const hexId = "8027fffffffffff";

ChildPosition​

The ChildPosition is a string that represents the H3 hexagon child position of resolution 5.

ChildPosition type definition
type ChildPosition = string;
ChildPosition example
const childPosition = "904";

Timestamp​

The Timestamp is a number that represents the Unix timestamp in seconds.

Timestamp type definition
type Timestamp = number;
Timestamp example
const timestamp = 1736851773;

Point​

The Point is an array of two numbers that represents a point on the map.

Point type definition
type Point = [number, number]; // [longitude, latitude], as in GeoJSON
Point example
const point = [-64.816, -18.751];

Polygon​

Requirements:

  • follow the type definition below;
  • at least 4 points;
  • the last point should be the same as the first point.
Polygon type definition
type Polygon = Array<Point>;
Polygon example
const polygon = [
[-64.816, -18.751],
[-64.816, -28.452],
[-51.672, -28.452],
[-51.672, -18.751],
[-64.816, -18.751],
];

Altitude​

The Altitude is a number that represents the altitude in thousands of feet.

Altitude type definition
type Altitude = number; // from 0 to 52
Altitude example
const altitude = 38;

Severity​

The Severity is a number from 0 to 4 that represents the severity level, where 0 is smooth and 4 is severe.

Severity type definition
enum Severity {
SMOOTH = 0,
LIGHT = 1,
LIGHT_MODERATE = 2,
MODERATE = 3,
MODERATE_SEVERE = 4,
}
Severity example
const severity = 0; // Severity.SMOOTH

Forecast​

The Forecast is a number from 0 to 24 that represents the forecast in hours.

Forecast type definition
type Forecast = number;
Forecast example
const forecast = 6;

EDR​

The EDR is an aircraft-independent measure of turbulence represented as a number from 0 to 1

EDR type definition
type EDR = number;
EDR example
const edr = 0.146;

AircraftCategory​

The aircraftCategory is a string literal type that represents the aircraft category.

  • The available values are from C10 to C110 with a step of 10;
AircraftCategory type definition
type AircraftCategory =
| "C10"
| "C20"
| "C30"
| "C40"
| "C50"
| "C60"
| "C70"
| "C80"
| "C90"
| "C100"
| "C110";
AircraftCategory example
const aircraftCategory = "C10";

hoursAgo​

The hoursAgo is a string type that determent when a report is due to expire.

  • so we get 2 reports, one is 45 minutes old, and the other is 75 minutes old, and hoursAgo is set to "1", the report that is 75 minutes old will be filtered out, as all reports older than 60 minutes
hoursAgo type definition
type hoursAgo = "0.5" | "1" | "2" | "3" | "4";

OneLayer Types​

forecastAlt​

Unlike OneLayer, forecast will show only 1 altitude. forecastAlt is a number type that will show the selected altitude.

  • this will be a number between 0 and 52, the default value is 35, that is 35,000 feet.
forecastAlt type definition
type forecastAlt = number; // 0 - 52

isForecastEnabled​

The isForecastEnabled is a boolean that controls whether forecast predictions are included when OneLayer builds the consolidated layer.

  • When true (default), OneLayer merges forecast data with OneLayer.
  • When false, forecast contributions are excluded from the displayed layer. Changing it triggers a new data request.

Use this toggle when you want to compare OneLayer with and without forecast, or when forecast is not relevant for a given map view.

isForecastEnabled type definition
type isForecastEnabled = boolean;
isForecastEnabled example
const isForecastEnabled = true;

sources​

The sources is an array of numbers that represents the sources of the report.

  • The sources are represented by the following numbers:
    • 0: FORECAST
    • 1: OBSERVATIONS
    • 2: PIREPS
    • 3: EDR
    • 4: ADSB
sources type definition
type Source = 0 | 1 | 2 | 3 | 4;
type Sources = Array<Source>;

OneLayerData​

The OneLayerData is an object with a set of functions that allows to get observations data emitted by the OneLayerFlow in different three formats.

RawReportsData type
type Report = {
hexId: ChildPosition,
alt: Altitude,
edr: EDR,
sev: Severity,
sources: Sources,
observationTime: Timestamp, // when the report was reported
usedSource: number, // the source that is most relevant and affects sev | edr | usedSourceTs
usedSourceTs: Timestamp // when the usedSource was reported
};

type OneLayersData = Record<HexId, Array<Report>>;
RawReportsData example

const oneLayersData: OneLayersData = {
// ...
"8027fffffffffff": [
{
hexId: "3934",
alt: 31,
edr: 0.23,
sev: 2,
sources: [4, 1],
observationTime: 1736851773,
usedSource: 4,
usedSourceTs: 1736851150
}
]
}

Observations Types​

ObservationsData​

The ObservationsData is an object with a set of functions that allows to get observations data emitted by the ObservationsFlow in different three formats.

ObservationsData object
type ObservationsData = {
toRawObject: () => RawReportsData;
toHexagonsArray: () => HexagonsArray;
toFeatureCollection: () => FeatureCollection;
};
RawReportsData type
type Report = {
hexId: ChildPosition;
observationTime: Timestamp;
edr: EDR;
sev: Severity;
alt: Altitude;
};

type RawReportsData = Record<HexId, Array<Report>>;
RawReportsData example
const rawReports: RawReportsData = {
// ...
"8027fffffffffff": [
{
hexId: "3934",
edr: 0.14662447257383968,
observationTime: 1736851773,
sev: 2,
alt: 31
}
],
// ...
}

ADS-B Types​

ADSBData​

The ADSBData is an object that represents the data that is emitted by the ADSBFlow.

ADS-B type definition
type Report = {
hexId: ChildPosition;
observationTime: Timestamp;
sev: Severity;
alt: Altitude;
};

type ADSBData = Record<HexId, Array<Report>>;
ADSBData example
const adsbData: ADSBData = {
"8027fffffffffff": [
{
hexId: "3934",
observationTime: 1736851773,
sev: 2,
alt: 31,
},
],
};

Forecast Types​

ForecastData​

The ForecastData is an object that represents the data that is emitted by the ForecastFlow.

ForecastData object
type ForecastData = {
toRawObject: () => RawReportsData;
toHexagonsArray: () => HexagonsArray;
toFeatureCollection: () => FeatureCollection;
};
RawReportsData type
type Report = {
alt: Altitude;
sev: Severity;
forecast: Forecast;
hexIds: Array<ChildPosition>;
}

type ForecastData = Record<HexId, Array<Report>>;
RawReportsData example
const rawReports: RawReportsData = {
// ...
"8027fffffffffff": [
{
alt: 38,
sev: 2,
forecast: 3,
hexIds: ["3934"]
}
]
// ...
}