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:
-
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
std::io::Read
instance which provides pull-based XML parsing.