Trino - Historical Data¶
Warning
Read this page closely - especially Tools & Performance Considerations - before writing any queries and especially if you are or are using an LLM.
This page contains everything you need to access OpenSky historical data via Trino.
Consult it thoroughly before reaching out for support; it likely contains the solution you are looking for.
Use the information here as your primary reference, rather than relying on AI-generated suggestions.
Users who repeatedly ignore the performance guidelines will be banned.
Besides the public REST API, OpenSky provides free access to its full dataset through an SQL-like query interface powered by Trino and MinIO. This service is available to university-affiliated researchers, governmental organisations, and aviation authorities for aviation-related research and incident investigations. Private or commercial entities must contact us for a licence.
Access is granted based on application review. We reserve the right to decline applications lacking sufficient justification and to revoke access in cases of misuse.
Getting Started¶
In 2024, OpenSky transitioned to a new backend with an updated access method. Follow the steps below to connect.
1. Register an Account¶
Register an OpenSky account by clicking Sign in at: OpenSky Register.
Verify your email address.
Go to My OpenSky → Request Data Access and fill out the application form.
2. Connect to Trino¶
Once access is granted, you can connect using:
3. Connecting via the Trino CLI¶
First, make sure you understand what Trino is and how to use it, then download and install the Trino CLI.
Connect with the following command:
trino --user=$USER --password \
--server=https://trino.opensky-network.org \
--external-authentication \
--catalog "minio" \
--schema "osky"
Important
Replace
$USERwith your OpenSky username. Usernames are stored in lowercase - always use lowercase when connecting via the CLI, Python, or any programmatic access method.The
--external-authenticationflag causes a browser window to open so you can log in via the OpenSky website. You must use the same account in the web interface as in the CLI command.
Exploring the Database¶
List all available tables:
SHOW TABLES;
The following datasets are covered in this guide. Use SHOW TABLES to check the tables and views available to your account:
Table |
|---|
acas_data4 |
allcall_replies_data4 |
df18_data4 |
flarm_decoded |
flights_data4 |
flights_data5 |
identification_data4 |
operational_status_data4 |
position_data4 |
readsb_adsc_sv |
readsb_mlat_sv |
rollcall_replies_data4 |
state_vectors_data4 |
velocity_data4 |
The _data4 suffix identifies the fourth implementation of the batch layer. Earlier versions are deprecated.
If you are familiar with SSR Mode S downlink communications, the table names should be self-explanatory. For a comprehensive introduction to SSR Mode S, see Christian Wolff’s radar tutorial. That said, most users only need the state_vectors_data4 table, which is covered in detail below.
State Vectors¶
State vectors are the most commonly used table. They summarise position, velocity, and status information derived from all raw Mode S messages. Inspect the schema with:
DESCRIBE state_vectors_data4;
Schema¶
Column |
Type |
Description |
|---|---|---|
time |
int |
Unix timestamp the state vector was valid at. |
icao24 |
string |
Unique 24-bit transponder address (hex). |
lat |
double |
Latitude in decimal degrees (WGS84). |
lon |
double |
Longitude in decimal degrees (WGS84). |
velocity |
double |
Speed over ground in metres per second. |
heading |
double |
Direction of movement in degrees from true north. |
vertrate |
double |
Vertical speed in m/s (positive = climbing). |
callsign |
string |
Flight identifier broadcast by the aircraft. |
onground |
boolean |
|
alert |
boolean |
ATC alert squawk active. |
spi |
boolean |
Special position indicator active. |
squawk |
string |
4-digit octal transponder code assigned by ATC. |
baroaltitude |
double |
Barometric altitude in metres. |
geoaltitude |
double |
Geometric (GNSS) altitude in metres. |
lastposupdate |
double |
Timestamp of the last recorded position update. |
lastcontact |
double |
Last time OpenSky received a signal from the aircraft. |
serials |
array<int> |
Serial numbers of the receivers that heard this message. |
hour |
int |
Partition column. Unix timestamp of the start of the hour this record belongs to. |
Units¶
State vectors use the following units. The sections below specify units for the other tables, including exceptions such as surface ground speeds in position_data4:
Speed: metres per second
Distance / altitude: metres
Time: seconds (Unix timestamps)
Example Query¶
Retrieve a randomly selected state vector from a specific hour:
SELECT *
FROM state_vectors_data4
WHERE hour = 1480759200
ORDER BY rand()
LIMIT 1;
Timestamps & Data Retention¶
OpenSky retains state vectors for up to 300 seconds after an aircraft leaves coverage. To exclude stale vectors, add:
AND time - lastcontact <= 15
state_vectors_data4 has unlimited retention since 2013, flights_data4 since 2016. Other tables contain data for fewer years.
Flights¶
flights_data4 contains one row per flight reconstructed from the state vectors, including a compact trajectory and estimated departure and arrival airports. These are inferred from received positions and coverage; the first and last observations are not necessarily the actual takeoff and landing times. An airport can remain unknown, and a callsign is not a unique flight identifier.
Inspect the schema before querying, especially when working with nested fields:
DESCRIBE flights_data4;
Schema¶
The types below use Trino names: integer corresponds to int and varchar to string in the state-vector schema above. row(...) denotes a nested record whose fields are listed in the description. Timestamps are Unix seconds, coordinates are WGS84 degrees, track altitudes are metres, and headings are degrees. Missing values can be null.
Column |
Type |
Description |
|---|---|---|
|
|
Aircraft transponder address as a lowercase hexadecimal string. |
|
|
Unix timestamp of the estimated start of the flight; may be null if departure was not observed. |
|
|
ICAO code of the departure airport estimated from the trajectory; null if no airport could be assigned. |
|
|
Unix timestamp of the estimated end of the flight. This determines the |
|
|
ICAO code of the arrival airport estimated from the trajectory; null if no airport could be assigned. |
|
|
Callsign most frequently observed during the flight. |
|
|
Compact trajectory: waypoints with |
|
|
Horizontal distance in metres from the first track point to the estimated departure airport. |
|
|
Vertical distance in metres from the first track point to the estimated departure airport. |
|
|
Horizontal distance in metres from the last track point to the estimated arrival airport. |
|
|
Vertical distance in metres from the last track point to the estimated arrival airport. |
|
|
Number of candidate departure airports considered by the flight reconstruction. |
|
|
Number of candidate arrival airports considered by the flight reconstruction. |
|
|
Candidate airports, each with |
|
|
Candidate arrival airports, with the same nested fields as the departure candidates. |
|
|
Partition column. Unix timestamp at 00:00 UTC on the day containing |
Example Query¶
Retrieve flights ending on 1 April 2026 (UTC):
SELECT icao24, callsign, firstseen, lastseen,
estdepartureairport, estarrivalairport
FROM flights_data4
WHERE day = 1775001600
LIMIT 10;
For a departure-time search, include subsequent arrival-day partitions as necessary: a flight can end on the next UTC day. A filter on firstseen or lastseen alone does not replace the required day filter; see Tools & Performance Considerations.
The Other Tables¶
Most tables other than state_vectors_data4 contain the columns mintime, maxtime, and msgcount, which summarise duplicate messages:
mintime - timestamp of the first message received in the interval.
maxtime - timestamp of the last message received in the interval.
msgcount - number of duplicate messages received.
For detailed specifications, refer to:
SSR Mode S tables (
acas_data4,allcall_replies_data4,rollcall_replies_data4): ICAO Annex 10 Volume 4.ADS-B tables (
identification_data4,operational_status_data4,position_data4,velocity_data4): RTCA DO-260B.
The flights_data4 dataset is described in Flights. It uses day partitions rather than hour partitions.
Example - all-call replies:
SELECT *
FROM allcall_replies_data4
WHERE hour = 1478293200
LIMIT 1;
ADS-C State Vectors (readsb_adsc_sv)¶
This table contains ADS-C (Automatic Dependent Surveillance–Contract) state vectors collected via JAERO and Readsb. ADS-C is a satellite-based surveillance technology used on oceanic and polar routes where conventional ground-based receivers provide no coverage. JAERO decodes ADS-C messages from Inmarsat ACARS satellite links.
Unlike the _data4 tables, this table does not contain mintime, maxtime, or msgcount columns.
Further reading: OpenSky ADS-C dataset and OpenSky Report 2025: Improving Crowdsourced Flight Trajectories with ADS-C Data.
Column |
Type |
Description |
|---|---|---|
time |
double |
Unix timestamp the state vector was valid at. |
icao24 |
varchar |
Unique 24-bit transponder address (hex). |
callsign |
varchar |
Flight identifier broadcast by the aircraft. |
lat |
double |
Latitude in decimal degrees (WGS84). |
lon |
double |
Longitude in decimal degrees (WGS84). |
velocity |
double |
Speed over ground in metres per second. |
heading |
double |
Direction of movement in degrees from true north. |
vertrate |
double |
Vertical speed in m/s (positive = climbing). |
baroaltitude |
double |
Barometric altitude in metres. |
hour |
bigint |
Partition column. Unix timestamp of the start of the hour this record belongs to. |
MLAT State Vectors (readsb_mlat_sv)¶
This table contains multilateration (MLAT) state vectors collected via mlat-client, mlat-server, and Readsb. MLAT uses time-difference-of-arrival measurements from multiple ground receivers to locate aircraft that do not transmit ADS-B position messages. Coverage depends on the density of participating receivers.
Unlike the _data4 tables, this table does not contain mintime, maxtime, or msgcount columns.
Column |
Type |
Description |
|---|---|---|
time |
double |
Unix timestamp the state vector was valid at. |
icao24 |
varchar |
Unique 24-bit transponder address (hex). |
lat |
double |
Latitude in decimal degrees (WGS84). |
lon |
double |
Longitude in decimal degrees (WGS84). |
hour |
integer |
Partition column. Unix timestamp of the start of the hour this record belongs to. |
Decoded FLARM Messages (flarm_decoded)¶
flarm_decoded contains decoded FLARM traffic received through the Open Glider Network (OGN), together with the original reception metadata. It supports research on gliders and other low-altitude traffic that may not appear in ADS-B state vectors. Further reading: OpenSky Report 2023: Low Altitude Traffic Awareness for Light Aircraft with FLARM.
Each row represents a decoded reception, rather than a fused state vector or a Mode S de-duplication group. The table has no mintime, maxtime, or msgcount columns. Receptions failing the CRC check, lacking the raw message or receiver position, failing to decode, or yielding a position more than 150 km from the receiver are excluded. The identifier namespace differs from ADS-B: do not join on icao24 alone without checking radioidentifiertype.
DESCRIBE flarm_decoded;
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
Partition column. Start of the UTC hour containing |
|
|
Receiving sensor type reported in the message envelope. |
|
|
Receiver latitude in WGS84 degrees. |
|
|
Receiver longitude in WGS84 degrees. |
|
|
Receiver altitude in metres, if available. |
|
|
Unix timestamp when the ingestion server received the message. |
|
|
Sensor receive timestamp from the envelope, if provided. |
|
|
Additional timestamp from the raw envelope, if provided. |
|
|
Estimated transmission time at the aircraft, in Unix seconds. |
|
|
Raw FLARM message in hexadecimal. |
|
|
CRC field from the raw envelope. |
|
|
Soft-bit representation of the received message and CRC, in hexadecimal, if available. |
|
|
Receiver name reported by OGN. |
|
|
Receiver clock error relative to NTP, in milliseconds. |
|
|
User-configured receiver frequency correction, in ppm. |
|
|
Additional automatic frequency correction, in ppm. |
|
|
Reception frequency in MHz. |
|
|
Reception channel. |
|
|
Signal-to-noise ratio reported by the detector. |
|
|
Signal-to-noise ratio reported by the demodulator. |
|
|
Envelope flag distinguishing OGN-tracker messages ( |
|
|
Whether the envelope CRC passed; failed CRCs are excluded from this table. |
|
|
Complete raw OGN UDP packet, if retained in the envelope. |
|
|
Unix transmission timestamp used for decoding; currently the same value as |
|
|
Raw 24-bit radio identifier as lowercase hexadecimal. Interpret it together with |
|
|
Numeric representation of the 24-bit radio identifier. |
|
|
Message type from the packet header. |
|
|
Identifier type: |
|
|
Reported urgency: |
|
|
Extended radio identifier field, in hexadecimal. |
|
|
Extended message-type field. |
|
|
Stealth/privacy flag reported by the sender. |
|
|
No-track flag reported by the sender. |
|
|
Protocol version used for transmission. |
|
|
Maximum receive protocol version reported by the sender. |
|
|
Truncated protocol time field; not a complete Unix timestamp. Use |
|
|
Reported aircraft or object category, such as glider, towplane, helicopter, or UAV. |
|
|
Decoded aircraft latitude in WGS84 degrees. |
|
|
Decoded aircraft longitude in WGS84 degrees. |
|
|
Decoded WGS84 altitude in metres. |
|
|
Turn rate in degrees per second. |
|
|
Ground speed in metres per second. |
|
|
Vertical speed in metres per second; positive means climbing. |
|
|
Ground track in degrees. |
|
|
Reported movement mode: |
|
|
Horizontal position accuracy estimate in metres (95% CEP). |
|
|
Vertical position accuracy estimate in metres (95% confidence). |
|
|
Velocity accuracy estimate in metres per second (95% confidence). |
|
|
Source Integrity Level, stored as a decoder enumeration name. |
|
|
System Design Assurance, stored as a decoder enumeration name. |
|
|
Navigation Integrity Category, stored as a decoder enumeration name. |
|
|
Normalised 24-byte FLARM radio payload. |
Example Query¶
SELECT decodedtimestamp, icao24, radioidentifiertype,
latitude, longitude, altitude, speed, climbrate, sensorname
FROM flarm_decoded
WHERE hour = 1775001600
LIMIT 10;
The hour partition follows transmission time, not timeatserver. Always include it even when also filtering on a more precise timestamp.
ACAS Messages (acas_data4)¶
Decoded short (DF 0) and long (DF 16) Airborne Collision Avoidance System replies. islongformat distinguishes the formats. Cross-link capability is available only in short replies; resolution-advisory fields are available only in long replies.
DESCRIBE acas_data4;
Schema¶
In addition to the shared decoded-message columns:
Column |
Type |
Description |
|---|---|---|
|
|
|
|
|
Airborne status reported by the aircraft. |
|
|
Cross-link capability; short replies only. |
|
|
ACAS sensitivity level code. |
|
|
Reply Information (RI) field. |
|
|
Decoded altitude in metres, when available. |
|
|
Validity of the Resolution Advisory Complement (RAC); long replies only. |
|
|
Bitfield of active resolution advisories; long replies only. |
|
|
Resolution Advisory Complement bitfield; long replies only. |
|
|
Do-not-pass-below advisory-complement flag; long replies only. |
|
|
Do-not-pass-above advisory-complement flag; long replies only. |
|
|
Do-not-turn-left advisory-complement flag; long replies only. |
|
|
Do-not-turn-right advisory-complement flag; long replies only. |
|
|
Resolution-advisory termination flag; long replies only. |
|
|
Multiple-threat flag; long replies only. |
Example Query¶
SELECT mintime, icao24, islongformat, altitude, activeresolutionadvisories
FROM acas_data4
WHERE hour = 1775001600
LIMIT 10;
All-Call Replies (allcall_replies_data4)¶
Decoded Mode S all-call replies (DF 11), carrying the transponder address, capability information, and interrogator identifier.
DESCRIBE allcall_replies_data4;
Schema¶
In addition to the shared decoded-message columns:
Column |
Type |
Description |
|---|---|---|
|
|
Transponder Capability (CA) field. |
|
|
Decoded interrogator identifier associated with the reply. |
Example Query¶
SELECT mintime, icao24, capabilities, interrogatorid
FROM allcall_replies_data4
WHERE hour = 1775001600
LIMIT 10;
Aircraft Identification Messages (identification_data4)¶
Decoded ADS-B aircraft identification messages (type codes 1–4). These contain the broadcast callsign and emitter category, rather than a position or a flight-plan identifier. Interpret emittercategory together with ftc.
DESCRIBE identification_data4;
Schema¶
In addition to the shared decoded-message columns:
Column |
Type |
Description |
|---|---|---|
|
|
Emitter category within the category set selected by the type code. |
|
|
Format type code of the identification message. |
|
|
Transmitted callsign / flight identification; may contain padding spaces. |
Example Query¶
SELECT mintime, icao24, identity, ftc, emittercategory
FROM identification_data4
WHERE hour = 1775001600
LIMIT 10;
Operational Status Messages (operational_status_data4)¶
Decoded ADS-B operational-status messages, describing transponder capabilities, operating modes, and navigation quality. The schema combines ADS-B versions 0, 1, and 2 and both airborne and surface subtypes. Use version and subtypecode when interpreting the other fields. Nullable small-integer capability fields use 1 for true and 0 for false; null means unavailable. Some non-nullable fields retain default values when they are not populated for a particular version or subtype.
DESCRIBE operational_status_data4;
Schema¶
In addition to the shared decoded-message columns:
Column |
Type |
Description |
|---|---|---|
|
|
0 for airborne, 1 for surface operational status. |
|
|
Decoder flag for an unrecognised capability code. |
|
|
Decoder flag for an unrecognised operational-mode code. |
|
|
Whether TCAS/ACAS is operational; airborne status. |
|
|
1090 MHz Extended Squitter receive capability. |
|
|
Air-referenced velocity reporting capability; airborne status. |
|
|
Low-transmit-power indicator; surface status. |
|
|
Target-state reporting capability; airborne status. |
|
|
Target/trajectory-change reporting capability; airborne status. |
|
|
978 MHz UAT receive capability. |
|
|
Navigation Accuracy Category for velocity; surface status. |
|
|
NIC supplement C; surface status. |
|
|
Active TCAS resolution-advisory flag. |
|
|
Active IDENT switch flag. |
|
|
Single-antenna operation flag. |
|
|
System Design Assurance level. |
|
|
Encoded GPS antenna-offset field; surface status. |
|
|
Decoded aircraft-length bound in metres; surface status. |
|
|
Decoded aircraft-width bound in metres; surface status. |
|
|
ADS-B version number. |
|
|
NIC supplement A bit. |
|
|
Navigation Accuracy Category for position, stored as a double. |
|
|
Decoded geometric vertical-accuracy bound in metres; -1 indicates unknown in the decoder. |
|
|
Source Integrity Level (SIL) code. |
|
|
Barometric-altitude integrity (NICbaro) flag; airborne status. |
|
|
Track-angle/heading interpretation flag; surface status. |
|
|
|
Example Query¶
SELECT mintime, icao24, version, subtypecode, positionnac, sourceintegritylevel
FROM operational_status_data4
WHERE hour = 1775001600
LIMIT 10;
Position Messages (position_data4)¶
Decoded ADS-B airborne and surface position messages. These are individual decoded message groups, not regularly sampled state vectors. Latitude, longitude, and altitude can be null when the CPR (Compact Position Reporting) decoder cannot resolve or accept the position. Use surface and baroalt to interpret the fields.
DESCRIBE position_data4;
Schema¶
In addition to the shared decoded-message columns:
Column |
Type |
Description |
|---|---|---|
|
|
Navigation Integrity Category (NIC) supplement A bit. |
|
|
Horizontal containment radius in metres. |
|
|
Navigation Integrity Category. |
|
|
Surveillance status: 0 = no condition, 1 = permanent alert, 2 = temporary alert, 3 = SPI. |
|
|
NIC supplement B bit. |
|
|
CPR frame parity: |
|
|
For airborne messages, |
|
|
Decoded WGS84 latitude in decimal degrees. |
|
|
Decoded WGS84 longitude in decimal degrees. |
|
|
Decoded altitude in metres. |
|
|
NIC supplement C bit. |
|
|
Surface ground speed in knots, as returned by the decoder. |
|
|
Surface ground-speed quantisation step in knots. |
|
|
Surface heading/track angle in degrees, when valid. |
|
|
ADS-B time (T) bit. |
|
|
|
Example Query¶
SELECT mintime, icao24, lat, lon, alt, baroalt
FROM position_data4
WHERE hour = 1775001600
AND surface = false
AND lat IS NOT NULL AND lon IS NOT NULL
LIMIT 10;
Roll-Call Replies (rollcall_replies_data4)¶
Decoded Mode S altitude and identity replies (DF 4/5) and Comm-B altitude and identity replies (DF 20/21). isid distinguishes identity replies from altitude replies. The raw Comm-B register payload is retained in message; its BDS register contents are not decoded into separate columns.
DESCRIBE rollcall_replies_data4;
Schema¶
In addition to the shared decoded-message columns:
Column |
Type |
Description |
|---|---|---|
|
|
Raw Comm-B register payload, when present. |
|
|
|
|
|
Flight Status (FS) field. |
|
|
Downlink Request (DR) field. |
|
|
Utility Message (UM) field. |
|
|
Interrogator identifier from the utility message. |
|
|
Identifier designator from the utility message. |
|
|
Encoded identity or altitude code, according to |
|
|
Decoded altitude in metres for altitude replies; otherwise null. |
|
|
Decoded four-digit octal Mode A squawk for identity replies; otherwise null. |
Example Query¶
SELECT mintime, icao24, isid, altitude, identity, message
FROM rollcall_replies_data4
WHERE hour = 1775001600
LIMIT 10;
Velocity Messages (velocity_data4)¶
Decoded ADS-B airborne ground-velocity messages. East–west and north–south components, ground speed, track, vertical rate, and geometric-minus-barometric altitude are stored where available. Surface ground speeds are in position_data4 instead.
DESCRIBE velocity_data4;
Schema¶
In addition to the shared decoded-message columns:
Column |
Type |
Description |
|---|---|---|
|
|
Whether the message uses the supersonic velocity encoding with a four-times-coarser step. |
|
|
Intent-change flag. |
|
|
IFR capability flag. |
|
|
Legacy navigation-accuracy category for velocity. Decoder-version compatibility can leave this at 0; do not infer velocity accuracy from it without checking the data. |
|
|
East–west ground-velocity component in metres per second (positive west, following the decoder convention). |
|
|
North–south ground-velocity component in metres per second (positive south, following the decoder convention). |
|
|
|
|
|
Vertical rate in metres per second; positive means climbing. |
|
|
Geometric minus barometric altitude in metres. The column name retains this legacy spelling. |
|
|
Ground track derived from the velocity components, in degrees from true north. |
|
|
Ground speed in metres per second. |
Example Query¶
SELECT mintime, icao24, velocity, heading, vertrate, geominurbaro
FROM velocity_data4
WHERE hour = 1775001600
LIMIT 10;
DF18 Messages (df18_data4)¶
Downlink Format 18 (DF18) carries non-transponder ADS-B, Traffic Information Service–Broadcast (TIS-B), and ADS-B rebroadcast (ADS-R) messages. df18_data4 combines these formats in one table, decoded with lib1090. Use cf (Control Field), addresstype, and msgkind to distinguish their contents:
cf0 or 1: non-transponder ADS-B.cf2, 3, or 5: TIS-B, including coarse position reports forcf3.cf6: ADS-R.cf4 or 7: management/reserved formats that the decoder retains as reception metadata without decoded payload fields.
Each row groups duplicate receptions. The reception columns follow the shared decoded-message columns, but this table uses address and addresstype instead of icao24. The raw address can identify a non-ICAO target or a track file; do not join it to an aircraft’s ICAO address without checking the address type and message format.
Payload fields that do not apply to the message kind are null. msgkind also identifies rows retained after an unsupported format or decoding failure: unsupported, bad_format, or decode_error. Decoded coordinates are populated only after the position decoder accepts the fix; a null position does not necessarily mean that reception failed.
Note
The scheduled DF18 decoding job is disabled in the documented batch configuration. The table definition alone does not establish continuous historical coverage.
DESCRIBE df18_data4;
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
Receiving sensors, with |
|
|
Raw 112-bit DF18 message as a hexadecimal string. |
|
|
Earliest receive timestamp across the sensors, in Unix seconds. |
|
|
Latest receive timestamp across the sensors, in Unix seconds. |
|
|
Total receptions represented by this row, including duplicate copies. |
|
|
Raw 24-bit address field as lowercase hexadecimal; not necessarily an ICAO aircraft address. |
|
|
Decoder classification of the address namespace; |
|
|
Control Field selecting the DF18 message format. |
|
|
ICAO/Mode A Flag, where the message format carries one. |
|
|
Decoded message kind in lowercase, or the decoding outcome described above. |
|
|
Extended Squitter format type code, where applicable. |
|
|
Raw Extended Squitter ME payload in hexadecimal, where applicable. |
|
|
Accepted decoded latitude in WGS84 degrees. |
|
|
Accepted decoded longitude in WGS84 degrees. |
|
|
Decoded altitude in metres; interpret using |
|
|
Altitude reference reported by the decoder, such as barometric or geometric. |
|
|
|
|
|
CPR frame parity: |
|
|
Encoded CPR latitude before position decoding. |
|
|
Encoded CPR longitude before position decoding. |
|
|
Number of bits in each encoded CPR coordinate. |
|
|
Whether an extracted position passed the decoder’s plausibility checks; null if no fix was extracted. |
|
|
Navigation Integrity Category. |
|
|
Navigation Accuracy Category for position. |
|
|
Navigation Accuracy Category for velocity. |
|
|
Source Integrity Level. |
|
|
Horizontal containment radius limit in metres. |
|
|
Surveillance status code, where available. |
|
|
NIC supplement A bit, where available. |
|
|
Additional NIC supplement: C for surface messages; airborne ADS-B version 2 rows store the B bit in this column. |
|
|
Ground speed in knots. |
|
|
Heading or ground track in degrees, according to the message kind. |
|
|
|
|
|
Airspeed in knots; interpret using |
|
|
|
|
|
Vertical rate in feet per minute; positive means climbing. |
|
|
Geometric minus barometric altitude in feet, as returned by the decoder. |
|
|
Whether the velocity message uses the supersonic encoding. |
|
|
TIS-B site/service-volume identifier; coarse TIS-B reports only. |
|
|
Ground track in degrees clockwise from true north; coarse TIS-B reports only. |
|
|
Lower bound of the reported ground-speed interval in knots; coarse TIS-B reports only. |
|
|
Upper bound of the reported ground-speed interval in knots; coarse TIS-B reports only. |
|
|
Transmitted callsign / flight identification, where available. |
|
|
Emitter category, where available. |
|
|
ADS-B/ADS-R version tracked by the stateful decoder. |
|
|
Partition column. Start of the UTC hour containing |
Units¶
Unlike state_vectors_data4 and velocity_data4, DF18 speed fields remain in knots, verticalrate in feet per minute, and geominusbaro in feet. alt and hcr are in metres. Convert these units before combining datasets.
Example Query¶
Retrieve accepted decoded positions from one hour:
SELECT mintime, address, addresstype, cf, msgkind,
lat, lon, alt, alttype
FROM df18_data4
WHERE hour = 1775001600
AND positionreasonable = true
AND lat IS NOT NULL AND lon IS NOT NULL
LIMIT 10;
Tools & Performance Considerations¶
Danger
Repeated failure to follow these guidelines will result in your account being suspended.
Always filter on the partition column. Always.
Python Libraries¶
traffic and pyOpenSky are the recommended tools for most users. They provide high-level APIs for trajectory extraction, flight filtering, and more, and they query Trino natively without requiring you to write raw SQL.
The performance rules below apply equally whether you are writing raw SQL or using traffic / pyOpenSky. Both libraries ultimately issue Trino queries on your behalf. If you request a large, unpartitioned time range through the Python API, you will trigger exactly the same full-table scan as a poorly written SQL query. Always scope your requests to the smallest time window you actually need.
Performance Guidelines¶
1. Always filter on the partition column.
Every query must include a
WHEREclause on the appropriate partition column:
hour- used by the state-vector and decoded-message tables described above, includingflarm_decoded.
day- used byflights_data4andflights_data5.The partition value is the Unix timestamp at the start of the respective hour or day. Without this filter, Trino performs a full table scan across the entire dataset, which is extremely slow and degrades performance for all users. Note that this is now automatically enforced by Trino since upgrading to version 479 and violating queries will be rejected.
-- Correct: partition filter present SELECT * FROM state_vectors_data4 WHERE hour = 1480762800 AND icao24 = 'a0d724'; -- WRONG: no partition filter - will scan the entire table SELECT * FROM state_vectors_data4 WHERE icao24 = 'a0d724';Note
For
flights_data4andflights_data5, always useWHERE day = <unix_day_timestamp>instead ofhour. Filtering ontimealone is not sufficient - you must also include the partition column.
2. Break large queries into smaller chunks.
Multiple targeted queries - each covering a short partition range - are faster and less resource-intensive than a single query spanning many days or weeks.
3. Limit parallel queries.
The system is a shared resource. Each user is limited to two concurrent queries and two queued queries. Global limits also apply; if you receive a queue error, wait and retry.
4. Avoid long-running queries.
The maximum query duration is 30 minutes, including queuing time. If a query takes more than five minutes, reduce the time frame and/or split it into batches.
5. Avoid large table scans.
If a query gets rejected with Exceeded scan limit of 100GB, reduce the time frame and/or split it into batches.
6. Do not run large global bulk downloads via ad-hoc queries.
Downloading all data there is in a given table globally for a week or more is not the purpose of a database interface such as Trino and almost never needed for a research project, which typically focuses on specific areas and/or aircraft. If you truly need many full-day datasets, i.e. complete table snapshots like these examples https://opensky-network.org/data/scientific#d11, contact us for alternative bulk-download solutions. Note that this is truly a very rare need and possible only in very exceptional cases, not for general student work, and may require an extraction fee to cover our time investment.
Killing Queries¶
If your process is stuck or running an unintended query, open the Trino UI, filter by your username, navigate to the query subpage, and click KILL in the top-right corner.
Useful Query Examples¶
The examples below are illustrative. For production use, consider the traffic and pyOpenSky libraries, which handle many of these patterns for you.
Latest Position per Aircraft (Every Minute)¶
SELECT v.*
FROM state_vectors_data4 v
JOIN (
SELECT FLOOR(time / 60) AS minute,
MAX(time) AS recent,
icao24
FROM state_vectors_data4
WHERE hour = 1480762800
GROUP BY icao24, FLOOR(time / 60)
) m
ON v.icao24 = m.icao24
AND v.time = m.recent
WHERE v.hour = 1480762800;
Last Position Seen by a Specific Receiver¶
SELECT v.*
FROM state_vectors_data4 v
JOIN (
SELECT MAX(t.time) AS recent,
COUNT(*) AS cnt,
t.icao24
FROM state_vectors_data4 t
CROSS JOIN UNNEST(t.serials) AS s(item)
WHERE t.hour = 1480762800
AND s.item = 1344390019
GROUP BY t.icao24
HAVING COUNT(*) > 30
) m
ON v.icao24 = m.icao24
AND v.time = m.recent
WHERE v.hour = 1480762800;
Note
The HAVING COUNT(*) > 30 filter reduces noise from erroneous receiver associations. You can refine results further with latitude and longitude constraints.
Count Distinct Aircraft in an Airspace Sector¶
Example: Frankfurt Airport vicinity.
SELECT COUNT(DISTINCT icao24)
FROM state_vectors_data4
WHERE lat BETWEEN 49.98 AND 50.07
AND lon BETWEEN 8.48 AND 8.62
AND hour = 1493892000;
Known Data Gaps¶
Due to outages, some historical data was permanently lost. Exclude the periods below from your research to ensure accuracy (all times UTC):
Start |
End |
|---|---|
2023-01-02 23:00 |
2023-01-03 10:00 |
2023-01-18 11:00 |
2023-01-23 07:00 |
2023-06-21 13:00 |
2023-06-21 22:00 |
2023-11-15 06:00 |
2023-11-16 08:00 |
2023-11-20 01:00 |
2023-11-20 03:00 |
2023-12-02 08:00 |
2023-12-05 03:00 |
2024-05-20 10:00 |
2024-05-21 05:00 |
2026-01-02 19:00 |
2026-01-03 18:00 |
2026-01-24 08:00 |
2026-01-24 17:00 |
You are now ready to query OpenSky’s historical dataset. If you discover anything noteworthy or have suggestions for improving this guide, please reach out to us.