Expand description
§kml_to_fgfp
This crate contains tools to process a flight plan from SimBrief in Google Earth’s .kml file
format to create a flight plan for FlightGear
, using the .fgfp
file extension.
§How to use it:
There are 6 steps to use this library:
-
Create an
EventWriter
, it will be used to write to the output file. -
Write the beginning of the .fgfp xml tree using the
write_start_of_tree
function. -
Create 2
Option<kml_to_fgfp::Airport>
setting the value toNone
if no departure or no destination airports are in the flight plan.Then call the
write_airports
function, passing the previous options as arguments. -
Create an
EventReader
, it will be used to read the .kml file. -
Call the
transform_route
function, which will need the xmlEventReader
,EventWriter
, and 2 airport options. This function creates the .fgfp’s route using waypoints with the information in the .kml file. -
Close the xml tree by calling the
close_tree
function.
Structs§
- Airport
- Represents an airport by it’s ICAO code and runway.
- Emitter
Config - Emitter configuration structure.
- Event
Reader - A wrapper around an
std::io::Read
instance which provides pull-based XML parsing.
Functions§
- close_
tree - Write the end of the .fgfp’s xml tree.
- transform_
route - This function will use the Placemarks in the .kml file to write a route using waypoints for the .fgfp file.
- write_
airports - Write the destination and arrival airports to the .fgfp’s xml tree. The airport codes should have ICAO codes.
- write_
start_ of_ tree - Write the start of the .fgfp’s xml tree. AKA the version, flight-rules, flight-type and estimated duration.