Simple line-based parser for airspace files in
OpenAir format (used by
flight instruments like Skytraxx and others).
If you want to use this library, you need the
function as entry point.
For an example on how to use the parse function, see the examples in the source repository.
OpenAir format is really underspecified. Every device
uses varying conventions. For example, there is nothing we can use as clear
delimiter for airspaces. Some files delimit airspaces with an empty line,
some with a comment. But on the other hand, some files even place comments
between the coordinates so that they cannot be used as delimiter either.
This parser tries to be very lenient when parsing, based on real life data.
The end of an airspace is reached when the next one starts (with an
record) or when the file ends.
Note: AT records (label placement hints) are currently ignored
An arc (DB record).
An arc segment (DA record).
A coordinate pair (WGS84).
Altitude, either ground or a certain height AMSL in feet.
Arc direction, either clockwise or counterclockwise.
A polygon segment.
Process the reader until EOF, return a list of found airspaces.