Skip to main content
Version: Next

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]; // [latitude, longitude]
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;
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 12 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"

Observations Types

ObservationsData

The ObservationsData is an object that represents the data that is emitted by the ObservationsFlow.

ObservationsData type definition
type Report = {
hexId: ChildPosition;
observationTime: Timestamp;
edr: EDR;
sev: Severity;
alt: Altitude;
};

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

ADS-B Types

ADSBData

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
}
]
}

Nowcasting Types

NowcastingData

NowcastingData type definition
type Report = {
alt: Altitude;
sev: Severity;
forecast: Forecast;
hexIds: Array<ChildPosition>;
}

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