Crate kml_to_fgfp

Source
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:

  1. Create an EventWriter, it will be used to write to the output file.

  2. Write the beginning of the .fgfp xml tree using the write_start_of_tree function.

  3. Create 2 Option<kml_to_fgfp::Airport> setting the value to None if no departure or no destination airports are in the flight plan.

    Then call the write_airports function, passing the previous options as arguments.

  4. Create an EventReader, it will be used to read the .kml file.

  5. Call the transform_route function, which will need the xml EventReader, EventWriter, and 2 airport options. This function creates the .fgfp’s route using waypoints with the information in the .kml file.

  6. Close the xml tree by calling the close_tree function.

Structs§

Airport
Represents an airport by it’s ICAO code and runway.
EmitterConfig
Emitter configuration structure.
EventReader
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.