Expand description
§ICAO Field 15 Parser
This module parses ICAO Field 15 entries from flight plans. Field 15 contains the route description including speed, altitude, waypoints, airways, and various modifiers.
Based on ICAO DOC 4444 specifications and implements the three basic token types:
- Points: Published Route Points (PRP), lat/lon coordinates, Point/Bearing/Distance, Aerodrome
- Connectors: ATS routes, SID, STAR, DCT, VFR/IFR, OAT/GAT
- Modifiers: Speed and Level changes
The parser tokenizes the input string, identifies each token type, and constructs a structured representation using Rust enums and structs.
§Acknowledgement
This parser is inspired by and adapted from the Python implementation available at https://github.com/pventon/ICAO-F15-Parser/
§Example
The following field 15 entry:
N0490F360 ELCOB6B ELCOB UT300 SENLO UN502 JSY DCT LIZAD DCT MOPAT DCT LUNIG DCT MOMIN DCT PIKIL/M084F380 NATD HOIST/N0490F380 N756C ANATI/N0441F340 DCT MIVAX DCT OBTEK DCT XORLO ROCKT2
becomes a structured sequence which serializes to JSON as follows:
[
{"speed": {"kts": 490}, "altitude": {"FL": 360}},
{"SID": "ELCOB6B"},
{"waypoint": "ELCOB"},
{"airway": "UT300"},
{"waypoint": "SENLO"},
{"airway": "UN502"},
{"waypoint": "JSY"},
"DCT",
{"waypoint": "LIZAD"},
// (truncated)
{"waypoint": "PIKIL"},
{"speed": {"Mach": 0.84}, "altitude": {"FL": 380}},
{"NAT": "NATD"},
{"waypoint": "HOIST"},
// (truncated)
{"waypoint": "XORLO"},
{"STAR": "ROCKT2"}
]§Usage
use thrust::data::field15::{Field15Element, Field15Parser};
let line = "N0490F360 ELCOB6B ELCOB UT300 SENLO UN502 JSY DCT LIZAD";
let elements: Vec<Field15Element> = Field15Parser::parse(&line);
match serde_json::to_string(&elements) {
Ok(json) => println!("{}", json),
Err(e) => eprintln!("JSON serialization error: {}", e),
}Structs§
- Field15
Parser - A parser for ICAO Field 15 route strings
- Modifier
- A modifier that changes flight parameters
Enums§
- Altitude
- Altitude representation
- Connector
- A connector between points (airway or direct)
- Field15
Element - A single element in a Field 15 ICAO route
- Point
- A point in the route (waypoint, coordinate, or navaid)
- Speed
- Speed representation