Type Definitions
General Types
HexId
The HexId
is a string that represents the H3 hexagon id of resolution 0 or 1.
type HexId = string;
const hexId = "8027fffffffffff"
ChildPosition
The ChildPosition
is a string that represents the H3 hexagon child position of resolution 5.
type ChildPosition = string;
const childPosition = "904"
Timestamp
The Timestamp
is a number that represents the Unix timestamp in seconds.
type Timestamp = number;
const timestamp = 1736851773;
Point
The Point
is an array of two numbers that represents a point on the map.
type Point = [number, number]; // [latitude, longitude]
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.
type Polygon = Array<Point>;
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.
type Altitude = number;
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.
enum Severity {
SMOOTH = 0,
LIGHT = 1,
LIGHT_MODERATE = 2,
MODERATE = 3,
MODERATE_SEVERE = 4
}
const severity = 0; // Severity.SMOOTH
Forecast
The Forecast
is a number from 0 to 12 that represents the forecast in hours.
type Forecast = number;
const forecast = 6;
EDR
The EDR
is an aircraft-independent measure of turbulence represented as a number from 0 to 1
type EDR = number;
const edr = 0.146;
AircraftCategory
The aircraftCategory
is a string literal type that represents the aircraft category.
- The available values are from
C10
toC110
with a step of10
;
type AircraftCategory = "C10" | "C20" | "C30" | "C40" | "C50" | "C60" | "C70" | "C80" | "C90" | "C100" | "C110"
const aircraftCategory = "C10"
Observations Types
ObservationsData
The ObservationsData
is an object that represents the data that is emitted by the ObservationsFlow.
type Report = {
hexId: ChildPosition;
observationTime: Timestamp;
edr: EDR;
sev: Severity;
alt: Altitude;
};
type ObservationsData = Record<HexId, Array<Report>>;
const observationsData: ObservationsData = {
"8027fffffffffff": [
{
hexId: "3934",
edr: 0.14662447257383968,
observationTime: 1736851773,
sev: 2,
alt: 31
}
]
}
ADS-B Types
ADSBData
type Report = {
hexId: ChildPosition;
observationTime: Timestamp;
sev: Severity;
alt: Altitude;
};
type ADSBData = Record<HexId, Array<Report>>;
const adsbData: ADSBData = {
"8027fffffffffff": [
{
hexId: "3934",
observationTime: 1736851773,
sev: 2,
alt: 31
}
]
}
Nowcasting Types
NowcastingData
type Report = {
alt: Altitude;
sev: Severity;
forecast: Forecast;
hexIds: Array<ChildPosition>;
}
type NowcastingData = Record<HexId, Array<Report>>;
const nowcastingData: NowcastingData = {
"8027fffffffffff": [
{
alt: 38,
sev: 2,
forecast: 3,
hexIds: ["3934"]
}
]
}