Code Monkey home page Code Monkey logo

airspaceconverter's Introduction

AirspaceConverter

A multi-platform and open source tool to convert between different airspace and waypoint formats.

Can read airspace and waypoint files in the following formats:

  • OpenAir
  • openAIP
  • KML/KMZ
  • SeeYou
  • LittleNavMap

Can write in the following formats:

  • KMZ
  • OpenAir
  • SeeYou
  • LittleNavMap
  • Polish
  • Garmin IMG

While converting to OpenAir AirspaceConverter estimates if the points are part of arcs or circumferences in order to make use of arc and circumference definitions of the OpenAir format and so avoiding to output all points one by one.
The ability to read KML/KMZ is based on the KMZ airspace files produced by Austrocontrol. This utility can convert also SeeYou .CUP waypoint files to KMZ (for Google Earth). The conversion to IMG for Garmin devices is done using cGPSmapper.
AirspaceConverter is written in C++11 and runs on Linux, Windows and macOS. In order to be immediately easy to use it has Qt and Windows MFC user interfaces. But it can also work from command line.

For more information's about this project: alus.it/AirspaceConverter
Contributors are, always, warmly welcome!

Why this software?

Airspace represented in 3D in Google Earth can help to visualize and better understand the airspace structure. Not only, having the planned route or track of a flight (as GPX file), displayed as well in Google Earth will make easy to check for airspace crossed or to be avoided.
This software can also be useful for maintainers of OpenAir airspace and SeeYou waypoints files, not only to visualize airspace and waypoints but also to verify the syntax of OpenAir or SeeYou lines entered.
Duplicate consecutive points will be ignored, the converter will warn about them while reading OpenAir files. This will also detect the special case of an unnecessary point repeating the end of the arc defined on the previous line.
For the "landable" waypoints in the CUP files an estimation of the runway perimeter is drawn on the earth surface, in order to do that not only the position is used but also the runway orientation and length. This is particularly useful to verify that the position of the airfield in the CUP file matches exactly the runway in Google Earth. In software like LK8000 the airfield position is considered as the exact center of the runway, orientation and length are used to assist for landing with an HSI and glide slope indications thus the correctness of position, orientation and length becomes really important.
openAIP (http://www.openaip.net/) provides a free, worldwide and updated airspace and waypoint repository but in his own format, while many devices and software support OpenAir airspace files. This software can convert: openAIP airspace to OpenAir and openAIP waypoints to SeeYou; so making openAIP data available to many portable devices.
AirspaceConverter can be used also to merge together several airspace or waypoint files (openAIP repeated airspaces will be automatically removed) and filter the result on a specific range of latitudes and longitudes.
Converting openAIP files to OpenAir has also the advantage to reduce significantly the size of the total airspace database used on a portable device. For example LK8000 recently supports also the openAIP format (feature that I implemented) but it is not always possible to load bigger openAIP files on older PNA devices, while the same files converted in OpenAir yes.
There are also cases where the "official" airspace files are available only in KML format like the Austrian airspace from Austrocontrol, also in this case is possible to convert it to OpenAir.
In case is required to import long lists of points (like state borders) from KML LineString tracks: just use the option -t and the tracks found will be closed and treated as unknown airspace. Then it will be possible to adapt the airspace definitions manually in the so converted OpenAir file.

About KML format

The Keyhole Markup Language, used by Google Earth is probably a good format to define models of buildings but it is not exactly practical to define airspace. This because it not possible, at least from my understanding, to define in the same 3D object points at altitudes with different references: it is the typical case of an airspace with AGL floor and AMSL ceiling.
One possible solution is to translate, where necessary all the altitudes to the same reference but to do that we need the know the altitude of the terrain at every location, reason why this software uses terrain maps.
Another important limitation of KML is that surfaces which follow the terrain are possible only at terrain altitude.
So please, be advised that, what you will see in Google Earth will not exactly match how airspace definitions are really intended.

LK8000 terrain raster map files

This program uses the same terrain raster maps (.dem) of LK8000 to convert altitudes from AGL to AMSL.
Also while importing SeeYou waypoints with null altitude (except unknown and normal types) the ground elevation will be used as altitude of that point. For doing this the terrain raster maps must be loaded before the waypoints. Ground heights between -5 and 5 meters will be anyway considered AMSL. In case the loaded terrain maps are overlapping, the one with the best resolution will be automatically used.
On the LK8000 website there is a wide terrain raster map collection.
The part of this program reading and using the terrain maps has been derived and adapted from LK8000 project.
To know more about LK8000 project: lk8000.it
The repository of LK8000 is available here: github.com/LK8000

AirspaceConverter shared library

This software is designed to keep completely separated functionalities from the user interfaces.
All the reading, writing and conversion features are in a common shared library: libAirspaceConverter can be compiled under different platforms and so used from different user interfaces.

AirspaceConverter command line

The airspaceconverter command line executable, works taking several arguments, for example:
airspaceconverter -q 1013 -a 35 -i inputFileOpenAir.txt -i openAIP_asp.aip -w waypoints.cup -w openAIP_wpt.aip -m terrainMap.dem -o outputFile.kmz

Possible options:

  • -q: optional, specify the QNH in hPa used to calculate height of flight levels
  • -a: optional, specify a default terrain altitude in meters to calculate AGL heights of points not covered by loaded terrain map(s)
  • -i: multiple, input file(s) can be OpenAir (.txt), openAIP (.aip), Google Earth .kmz, .kml)
  • -w: multiple, input waypoint file(s) can be SeeYou (.cup), openAIP (.aip) or LittleNavMap (.csv)
  • -m: optional, multiple, terrain map file(s) (.dem) used to lookup terrain heights
  • -l: optional, set filter limits in latitude and longitude for the output, followed by the 4 limit values: northLat,southLat,westLon,eastLon where the limits are comma separated, expressed in degrees, without spaces, negative for west longitudes and south latitudes
  • -o: optional, output file .kmz (Google Earth), .txt (OpenAir), .cup (SeeYou), .csv (LittleNavMap), .img (Garmin) or .mp (Polish). If not specified will be used the name of first input file as KMZ
  • -p: optional, when writing in OpenAir avoid to use arcs and circles but only points (DP)
  • -s: optional, when writing in OpenAir use coordinates always with minutes and seconds (DD:MM:SS)
  • -d: optional, when writing in OpenAir use coordinates always with decimal minutes (DD:MM.MMM)
  • -t: optional, when reading KML/KMZ files treat also "LineString" tracks as airspaces
  • -v: print version number
  • -h: print short guide

At least one input airspace or waypoint file must be present.
Warning: any already existing output file will be overwritten.

Graphical user interface

In order to be portable, the graphical interface is written in Qt and actually it can be compiled in Linux, Windows and macOS.
For Windows only is also available a Windows MFC user interface; if, while starting it, you get the error about VCRUNTIME140.dll missing: it can be easily fixed installing the: Microsoft VC++ redistributable, this will allow this software to run also on older Windows versions such us WindowsXP.
This is the default way to use the graphical user interface:

  1. Choose the desired output format.
  2. If needed, specify the QNH to be used for calculating the height of flight levels, this must be done before reading airspace files.
  3. If converting to GoogleEarth specify a default terrain altitude to be used for the points not under terrain raster map coverage.
  4. Select as input multiple openAIP (.aip) OpenAir (.txt) and/or GoogleEarth (.kmz) files or the folder containing them.
  5. If converting to GoogleEarth or to find missing altitudes of SeeYou waypoints it is possible to load multiple raster map files (.dem) with the terrain altitude.
  6. And/or select one or multiple waypoints files (.cup, .csv) or the folder containing them.
  7. Optionally configure the latitude and longitude ranges for filtering the output.
  8. If converting to OpenAir choose if to output only points and the desired coordinates format.
  9. Press the "Convert" button.
  10. The converter will ask where to save the converted file and then the conversion process will start.
  11. Verify if the output is correct and report any problem found.

Disclaimer

WARNING: this software is experimental. The generated output files may contains errors.
So please always verify the generated files before using in flight and report any error found.
By using this program you understand and completely agree that the generated output files (maybe wrong) are just for demonstration purposes and they do not absolutely substitute the official AIP publications.
Please always refer to official AIP publications for valid and updated airspace definitions.

Downloads

The already compiled executables are available to download from the project downloads page
For the Linux distributions based on Debian there is a also an APT repository available.

Build dependencies

In order to compile this project the following libraries are required:

  • Qt (libqt4-dev)
  • libzip2 (libzip-dev) and dependencies (zlib)
  • Boost libraries (libboost-filesystem-dev and libboost-locale-dev)

Compiling and installing AirspaceConverter from sources on Linux

First it is necessary to install the dependencies, on a Debian based distribution it would be:
sudo apt install libzip-dev libboost-filesystem-dev libboost-locale-dev libqt5-private-dev lsb-release
On older Ubuntu or Debian install libqt4-dev instead of libqt5-private-dev On Fedora:
sudo dnf install libzip-devel boost-devel qt-devel lsb-release
Then, to compile, from the root of this project: ./build.sh
To install: ./install.sh
This will install everything: the shared library the command line executable and the Qt GUI interface.
After it will be possible to run AirspaceConverter CLI from anywhere simply calling: airspaceconverter
The same for the AirspaceConverter Qt GUI graphical interface: airspaceconverter-gui
To uninstall (from the root of the project): ./uninstall.sh

Compiling and installing AirspaceConverter from sources on macOS

First it is necessary to install Qt and the other dependencies:
brew install libzip boost
Make sure to have the Qt tools reachable from your $PATH. This can be done, for example, adding to .bash_profile a line like:
export PATH="$HOME/Qt/<Qt version>/clang_64/bin":"$PATH"
Then, to compile and install, from the root of this project: ./install.sh
This will install everything: the shared library the command line executable and the Qt GUI interface.
After it will be possible to run AirspaceConverter CLI from anywhere simply calling: airspaceconverter
While the AirspaceConverter Qt GUI graphical interface will be directly available from the Launchpad menu.
To uninstall (from the root of the project): ./uninstall.sh

Compiling AirspaceConverter on Windows

In the "VisualStudio" folder there is the VisualStudio solution and project files.
It requires to have the proper Boost libraries installed, with their location configured in the VS project.
From SourceForge download the latest version of Boost libraries alredy compiled for VisualStudio.
While libzip and zlib (also not included in this repository) can be obtained via nuget.
When compiling with VisualStudio 2017 (vs141), and newer, in order to link with libzip it is necessary to modify libzip.targets located in VisualStudio\packages\libzip.1.1.2.7\build\native replacing all occurrencies of PlatformToolset.ToLower().IndexOf('v140') with PlatformToolset.ToLower().IndexOf('v14')
If required cGPSmapper can be found in the portable distribution archive of this project.

Placemarks icons credits

Some of the placemark icons used for displaying the waypoints in Google Earth included in the produced KMZ file (and so used by this project) are coming from: Maps Icons Collection
On Windows, the folder icons with the placemarks PNG icons must be kept in the same location of AirspaceConverter executable.

Contributors

  • Valerio Messina : packaging for Ubuntu, CSV waypoints, various issues fixed and testing

Contacts

Author: Alberto Realis-Luc
Web: alus.it/AirspaceConverter
E-mail: [email protected]

airspaceconverter's People

Contributors

alus- avatar efa avatar johnthomas22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

airspaceconverter's Issues

Make Windows MSI installer

This should improve the Windows user experience and hopefully solve the 32 bit - 64 bit problems. The installer should install the 32bit version under C:\ProgramFiles(x86)\AirspaceConverter with icons uninstaller and so on...

Produce better IMG Garmin maps

On request of a couple of users, the program should be able to produce better IMG maps for Garmin devices using cGPSmapper.

Remove airspace class specification from name

Sometimes the airspace class is specified also in the name like: "Name Class: B" when writing to OpenAir already an airspace of that class would be nice to avoid to write the class also there. While would be nice to keep/add that information in KMZ for example for a TMA to specify somewhere what class is.

Remember airspace with UNLIMITED top altitude

On request from Massimo Belloni:
Draw them at FL600 in Google Earth. (Maximum height for civil airspace)
Not more high otherwise is messing up...
Set them back with AH UNLIMITED when writing in OpenAir.
Write UNLIMITED in the Google Earth labels so we know that are unlimited...

Verify line endings

Una cosa curiosa: passo gli spazi aerei ad un amico che ha ANP, il quale è un po' pistino sui contenuti degli stessi: se non è tutto OK genera un sacco di errori.

Nel caso corrente non riusciva a caricarli e si bloccava a metà. Ha poi scoperto che il problema era dato dal fato che in alcuni casi le righe erano separate solo da LF inceve che CRLF (con Notepad++ non riesco a vedere questa stranezza, però con il Notepad nativo sono riuscito a vedere quali erno cotruiti in questo modo strano.

Nono ho idea del perchè questo sia successo (uso solamente Notepad++), ma prescindere da questo, in tema di controlli, non sarebbe male se il tuo convertitore evidenziasse anche se il carattere di separazione tra le righe fosse fatto solo da LF anzichè dal più normale (windows) CRLF.

Se guardi il file che ti allego, troveri nella zona degli spazi di Erice (ma anche in acluni altri casi) quest particolarità (della quale continuo a non capire l'origine).

Build DEB packges for Ubuntu

Adapt the debianize.sh script to produce the DEB packages also for Ubuntu 16.04 considering the proper versions of the dependencies.

Make library

All functionalities should be in a shared library.
The user interface should be then separated, using the library and compiled for different platforms.

Crack between areas

I have used my own airspace files in the converter and discovered the following problem. For unclear reasons, two areas that are adjacent to each other, are displayed with a crack between them, see picture. The same file is used in LK8000 without any error.

OpenAir Airspace definition:

*______________________
*>>> EHR4D VLIEHORS <<<
AC R
AN EHR4D [a]
AH 1500FT MSL
AL SFC
DP 53:09:17 N 004:40:28 E
V X=53:15:00 N 004:57:00 E
DB 53:11:06 N 004:38:08 E , 53:15:00 N 004:37:01 E
V D=-
DB 53:15:00 N 004:43:41 E , 53:10:13 N 004:46:21 E
*to point of origin
*______________________
*>>> EHR4F VLIEHORS <<<
AC R
AN EHR4F [a]
AH 5000FT MSL
AL SFC
V X=53:15:00 N 004:57:00 E
DB 53:15:00 N 004:37:01 E , 53:21:59 N 004:40:45 E
V D=-
DB 53:19:40 N 004:46:10 E , 53:15:00 N 004:43:41 E
*to point of origin

splat 4d-4f

Make script to build debian packages

DEB packages should be built automatically for Debian 7 (wheezy) on 32 bit, Debian 8 (jessie) on 64 bit and Debian 9 (stretch) on 64 bit.
The script should take care of setting the right dependencies versions.

Remove OpenAIP duplicate airspaces

Apparently it seems that in the OpenAIP files there are duplicate airspaces: same type/class, same floor and ceiling and exactly some points; but different names. When loading OpenAIP would be nice to avoid the duplicates.

Debianization

Make deb packages for Debian Jessie and Wheezy. On 32 and 64 bits.

NOTAMs via XML files

A new request from: Ico van der Bijl.

I've just updated your AirspaceConverter to the latest version (v0.23) and was wondering if you have ever thought about adding xml files to the converter.

First I have to explain that I'm totally unfamiliar with programming and don't know if my request is even possible.

As you may know to execute a safe flight you have to do flightpreparation and check the charts and NOTAMS. This takes a lot of time and I'm looking for solutions to make things easier.

I get my NOTAMS from AVINOR IPPC which is connected to the European AIS Database (EAD) from Eurocontrol. I also have an account registered to get the information directly from the EAD. They present the information in 4 different layouts HTML, XML, TXT and PDF.

I thought what would be nicer if one could visualize NOTAM information like you did with the airspacestructure? Therefore my request if this is possible and is XML the layout you need?

I attached a xml file I saved this morning from the EAD.
AreaPIB.zip

EAD login (register first): www.ead.eurocontrol.int

Perhaps this is useful:

  • I think you can use the NOTAM numbers as the name of the area. In this way it can be easily checked with printed NOTAM lists.
  • Many areas are defined as cylinders (geographical position with a radius and a lower and upper limit).
  • The more challenging areas are those that consist of multiple positions sometimes in combination with an arc (clockwise or counterclockwise). I saw that these areas are defined separately as free text.
  • If you want to create an account for the EAD at EuroControl, make sure that you use Firefox as a browser together with an outdated JAVA plugin (Java SE Runtime Environment 8u25). See: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html

Double lines vertical limits

Bug reported by: Ico van der Bijl

Problem with a converted openair file (see attachment, TMA1 and TMA1X files and pictures). In TMA1X there are 7 additional positions but these are causing double lines (upper and lower limit) in the displayed 3D figures.

tma1

tma1x

TMA1.txt
TMA1X.txt

The ZIP here are in relity KMZ so rename to KMZ after download.
TMA1.zip
TMA1X.zip

Guess airspace class of CTAs and TMAs from KMZ labels

While reading KMZ the CTAs and TMAs (both not supported in OpenAir) sometimes they have written in the label what kind of airspace class they are. So this information should be stored and used when outputting to OpenAir (as generic airspace of a certain class).

Bugs in the Qt interface

There are a couple of bugs in the Qt interface.
By default it is suggesting a file.kmz as output file name also if another format has been selected in the combo box. It is crashing if I try to choose the output file name before than reading airspaces.

Some open folder button not disabled on WindowsXP

On Windows XP the same open folder dialog is not available, so all buttons (airspaces, waypoints, terrain maps) opening a folder should be disabled. Otherwise they will open an unuseful open file dialog.

Always displays placemarks for airfields

I noticed that you have tried to create runways when information about waypoint style, runway length and direction was available. The problem with this approach is that the waypoint geographical position isn't always the runway position but the aerodrome reference point. This resulted in totally incorrect runway positions.
Maybe it is better to keep things simple and stick to the shapes (e.g. pin) that come with GE.

Make QT user inferace

QT will allow to use the program with graphical user interface on Linux, Windows and Mac.

Possible bug to verify

Bug reported by: Massimo Belloni

Con la nuova rivoluzione degli spazi aerei (10 novembre) l'Italia sarà tutta spazio D sopra (grossomodo) FL85.

Sto preparando gli spazi aerei, ma ho scoperto uno strano comportamento relativo alla CTA Roma Zona 2 "Mediterraneo": se guardi il file che ti allcudo, vedrai che su Sicilia/Calabrie e una fettina davanti alla toscana quello spazio aereo ("D") non c'è (anzi, cambia i bordi in funzioe del livello di zoom). Ho provato anche a generare la carta senza i file .DEM scaricati da LK8000 (che, peraltro, pare non coprano interamente l'Italia), ma il problema permane (sembra che lo spazio si "assottigli" fino a sparire).

Potrebbe essere un bug?

ITA_ASP_10-NOV-2016_V03.txt

KML wrong for CUP airfields

When importing CUP waypoints, specifically airfields, the KML file is not generated correctly. The tags are wrong and not closed correctly with random text in it. This makes Google Earth give error and the file is not displayed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.