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

Represents an airport by it’s ICAO code and runway.
Emitter configuration structure.
A wrapper around an std::io::Read instance which provides pull-based XML parsing.

Functions

Write the end of the .fgfp’s xml tree.
This function will use the Placemarks in the .kml file to write a route using waypoints for the .fgfp file.
Write the destination and arrival airports to the .fgfp’s xml tree. The airport codes should have ICAO codes.
Write the start of the .fgfp’s xml tree. AKA the version, flight-rules, flight-type and estimated duration.