├── macOS ├── PkgInfo ├── AirspaceConverter.icns ├── clean.sh ├── uninstall.sh ├── launch.sh ├── install.sh ├── crossBuild.sh ├── Info.plist ├── makeZip.sh ├── makeDmg.sh ├── Makefile.darwin-clang++ └── makeApp.sh ├── icons ├── dam.png ├── ndb.png ├── vor.png ├── bridge.png ├── castle.png ├── normal.png ├── sender.png ├── tunnel.png ├── airfield.png ├── mounttop.png ├── cathedral.png ├── cooltower.png ├── glidersite.png ├── mountpass.png ├── outlanding.png ├── powerplant.png ├── undefined.png ├── windturbine.png ├── airfieldgrass.png ├── airfieldsolid.png ├── intersection.png └── powerlinepole.png ├── Windows ├── Logo.jpg ├── AirspaceConverterMFC │ ├── resource.h │ ├── AirspaceConverterMFC.rc │ ├── res │ │ ├── AirspaceConverter.ico │ │ └── AirspaceConverterMFC.rc2 │ ├── stdafx.cpp │ ├── targetver.h │ ├── packages.config │ ├── AirspaceConverterApp.hpp │ ├── Processor.hpp │ ├── AirspaceConverterApp.cpp │ ├── LimitsDlg.hpp │ ├── stdafx.h │ ├── AirspaceConverterMFC.vcxproj.filters │ ├── AirspaceConverterDlg.hpp │ ├── Processor.cpp │ └── LimitsDlg.cpp ├── AirsapceConverter Website.url ├── AirspaceConverter source code.url ├── AirspaceConverterLib │ ├── packages.config │ ├── AirspaceConverterLib.vcxproj.filters │ └── AirspaceConverterLib.vcxproj ├── AirspaceConverter │ ├── packages.config │ ├── AirspaceConverter.vcxproj.filters │ └── AirspaceConverter.vcxproj ├── generateReadme.sh └── AirspaceConverter.sln ├── AirspaceConverter.gif ├── AirspaceConverter.png ├── QtGUI ├── resources.qrc ├── .qmake.stash ├── AboutDialog.hpp ├── main.cpp ├── LimitsDialog.hpp ├── AboutDialog.cpp ├── MainWindow.hpp ├── LimitsDialog.cpp ├── AirspaceConverterQt.pro └── AboutDialog.ui ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── build.yml ├── SECURITY.md ├── clean.sh ├── CONTRIBUTING.md ├── src ├── Polish.hpp ├── Waypoint.cpp ├── Airfield.cpp ├── SeeYou.hpp ├── CSV.hpp ├── Airfield.hpp ├── OpenAIP.hpp ├── RasterMap.hpp ├── Altitude.hpp ├── KML.hpp ├── Waypoint.hpp ├── Altitude.cpp ├── OpenAir.hpp ├── Polish.cpp ├── AirspaceConverter.hpp ├── RasterMap.cpp └── Airspace.hpp ├── uninstall.sh ├── test ├── processAir.sh ├── test.sh ├── openairSort.sh ├── check.sh └── tstCsv.sh ├── install.sh ├── .gitignore ├── CODE_OF_CONDUCT.md ├── Makefile ├── makeAppImage.sh ├── airspaceconverter.xpm └── airspaceconverter.1 /macOS/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /icons/dam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/dam.png -------------------------------------------------------------------------------- /icons/ndb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/ndb.png -------------------------------------------------------------------------------- /icons/vor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/vor.png -------------------------------------------------------------------------------- /Windows/Logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/Windows/Logo.jpg -------------------------------------------------------------------------------- /icons/bridge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/bridge.png -------------------------------------------------------------------------------- /icons/castle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/castle.png -------------------------------------------------------------------------------- /icons/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/normal.png -------------------------------------------------------------------------------- /icons/sender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/sender.png -------------------------------------------------------------------------------- /icons/tunnel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/tunnel.png -------------------------------------------------------------------------------- /icons/airfield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/airfield.png -------------------------------------------------------------------------------- /icons/mounttop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/mounttop.png -------------------------------------------------------------------------------- /AirspaceConverter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/AirspaceConverter.gif -------------------------------------------------------------------------------- /AirspaceConverter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/AirspaceConverter.png -------------------------------------------------------------------------------- /icons/cathedral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/cathedral.png -------------------------------------------------------------------------------- /icons/cooltower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/cooltower.png -------------------------------------------------------------------------------- /icons/glidersite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/glidersite.png -------------------------------------------------------------------------------- /icons/mountpass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/mountpass.png -------------------------------------------------------------------------------- /icons/outlanding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/outlanding.png -------------------------------------------------------------------------------- /icons/powerplant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/powerplant.png -------------------------------------------------------------------------------- /icons/undefined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/undefined.png -------------------------------------------------------------------------------- /icons/windturbine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/windturbine.png -------------------------------------------------------------------------------- /icons/airfieldgrass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/airfieldgrass.png -------------------------------------------------------------------------------- /icons/airfieldsolid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/airfieldsolid.png -------------------------------------------------------------------------------- /icons/intersection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/intersection.png -------------------------------------------------------------------------------- /icons/powerlinepole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/icons/powerlinepole.png -------------------------------------------------------------------------------- /macOS/AirspaceConverter.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/macOS/AirspaceConverter.icns -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/Windows/AirspaceConverterMFC/resource.h -------------------------------------------------------------------------------- /QtGUI/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | airspaceconverter128.xpm 4 | 5 | 6 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/AirspaceConverterMFC.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/Windows/AirspaceConverterMFC/AirspaceConverterMFC.rc -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/res/AirspaceConverter.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/Windows/AirspaceConverterMFC/res/AirspaceConverter.ico -------------------------------------------------------------------------------- /Windows/AirsapceConverter Website.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,2 3 | [InternetShortcut] 4 | IDList= 5 | URL=https://www.alus.it/AirspaceConverter 6 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/res/AirspaceConverterMFC.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alus-it/AirspaceConverter/HEAD/Windows/AirspaceConverterMFC/res/AirspaceConverterMFC.rc2 -------------------------------------------------------------------------------- /Windows/AirspaceConverter source code.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,11 3 | [InternetShortcut] 4 | IDList= 5 | URL=https://github.com/alus-it/AirspaceConverter 6 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/stdafx.cpp: -------------------------------------------------------------------------------- 1 | 2 | // stdafx.cpp : source file that includes just the standard includes 3 | // AirspaceConverter.pch will be the pre-compiled header 4 | // stdafx.obj will contain the pre-compiled type information 5 | 6 | #include "stdafx.h" 7 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterLib/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Windows/AirspaceConverter/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Windows/generateReadme.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 24/3/2020 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2020 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | echo Generating Readme.rtf... 14 | pandoc -s ../README.md -o Readme.rtf 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /macOS/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 18/2/2020 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2020 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Delete application bundle and distribution files 14 | echo "Cleaning macOS distribution files ..." 15 | rm -rf AirspaceConverter.app 16 | rm -f AirspaceConverter*.zip 17 | rm -f AirspaceConverter*.dmg 18 | -------------------------------------------------------------------------------- /QtGUI/.qmake.stash: -------------------------------------------------------------------------------- 1 | QMAKE_CXX.QT_COMPILER_STDCXX = 201703L 2 | QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 11 3 | QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 2 4 | QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0 5 | QMAKE_CXX.COMPILER_MACROS = \ 6 | QT_COMPILER_STDCXX \ 7 | QMAKE_GCC_MAJOR_VERSION \ 8 | QMAKE_GCC_MINOR_VERSION \ 9 | QMAKE_GCC_PATCH_VERSION 10 | QMAKE_CXX.INCDIRS = \ 11 | /usr/include/c++/11 \ 12 | /usr/include/x86_64-linux-gnu/c++/11 \ 13 | /usr/include/c++/11/backward \ 14 | /usr/lib/gcc/x86_64-linux-gnu/11/include \ 15 | /usr/local/include \ 16 | /usr/include/x86_64-linux-gnu \ 17 | /usr/include 18 | QMAKE_CXX.LIBDIRS = \ 19 | /usr/lib/gcc/x86_64-linux-gnu/11 \ 20 | /usr/lib/x86_64-linux-gnu \ 21 | /usr/lib \ 22 | /lib/x86_64-linux-gnu \ 23 | /lib 24 | -------------------------------------------------------------------------------- /clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 9/12/2017 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2017 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Clean everything 14 | echo Clean everything... 15 | 16 | # Clean Qt user interface 17 | rm -R -f buildQt 18 | 19 | # Clean shared library and command line version 20 | make clean 21 | 22 | # Clean macOS stuff 23 | cd macOS 24 | ./clean.sh 25 | cd .. 26 | 27 | echo "Full clean done." 28 | 29 | exit 0 30 | 31 | -------------------------------------------------------------------------------- /macOS/uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 18/2/2020 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2020 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Remove older version of GUI application if present 14 | if [[ -d /Applications/AirspaceConverter.app ]] 15 | then 16 | echo "Removing already installed AirspaceConverter GUI application" 17 | rm -rf /Applications/AirspaceConverter.app/ 18 | fi 19 | 20 | echo "MacOS GUI application uninstallation done." -------------------------------------------------------------------------------- /QtGUI/AboutDialog.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | 16 | namespace Ui { 17 | class AboutDialog; 18 | } 19 | 20 | class AboutDialog : public QDialog 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | explicit AboutDialog(QWidget *parent = nullptr); 26 | ~AboutDialog(); 27 | void show(); 28 | 29 | private: 30 | Ui::AboutDialog *ui; 31 | }; 32 | -------------------------------------------------------------------------------- /QtGUI/main.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Authors : Alberto Realis-Luc 5 | // Valerio Messina 6 | // Web : https://www.alus.it/AirspaceConverter 7 | // Repository : https://github.com/alus-it/AirspaceConverter.git 8 | // Copyright : (C) 2016 Alberto Realis-Luc 9 | // License : GNU GPL v3 10 | // 11 | // This source file is part of AirspaceConverter project 12 | //============================================================================ 13 | 14 | #include "MainWindow.hpp" 15 | #include 16 | #include 17 | 18 | int main(int argc, char *argv[]) { 19 | QApplication a(argc, argv); 20 | setlocale(LC_ALL, "C"); // so std::stod recognize dot as decimal separator 21 | MainWindow w; 22 | w.show(); 23 | return a.exec(); 24 | } 25 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | First of all thanks for your interest in willing to contribute to AirspaceConverter! 2 | 3 | Reporting bugs 4 | ============== 5 | Reporting bugs should be done preferably creating a new issue on GitHub. 6 | It's essential that the problem occurred should be really well documented so please attach logs, output, crash dumps and screenshots. 7 | Alternatively a bug can be reported also writing to admin@alus.it 8 | 9 | Requesting new features 10 | ======================= 11 | Also new features should be requested preferably using the issues page on GitHub of this project. 12 | 13 | Participate to the development 14 | ============================== 15 | If you wish to contribute adding your implementations you are really welcome! 16 | Just submit your pull request and it will be evaluated to be merged. 17 | Please remember to explain and motivate your changes (where necessary). 18 | Every change resulting as improvement will be certainly merged! 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /macOS/launch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 17/2/2020 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2020 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Make sure that we are on macOS 14 | if [ "$(uname)" != "Darwin" ]; then 15 | echo "ERROR: this script is only for macOS ..." 16 | exit 1 17 | fi 18 | 19 | # Build macOS application bundle if not yet done 20 | if [[ ! -d ./AirspaceConverter.app ]] 21 | then 22 | echo "Building macOS application bundle which was not yed done..." 23 | ./makeApp.sh 24 | fi 25 | 26 | # Launch the AirspaceConverter application from here (not the installed one) 27 | echo "Launching local AirspaceConverter application" 28 | open ./AirspaceConverter.app 29 | -------------------------------------------------------------------------------- /src/Polish.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | #include 16 | #include 17 | 18 | class Airspace; 19 | 20 | class Polish { 21 | public: 22 | Polish() {} 23 | ~Polish() {} 24 | bool Write(const std::string& filename, const std::multimap& airspaces); 25 | 26 | private: 27 | void WriteHeader(const std::string& filename); 28 | 29 | const static std::string MakeLabel(const Airspace& airspace); 30 | //static const int types[]; 31 | std::ofstream file; 32 | }; 33 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/AirspaceConverterApp.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | 15 | #ifndef __AFXWIN_H__ 16 | #error "include 'stdafx.h' before including this file for PCH" 17 | #endif 18 | 19 | #include "resource.h" // main symbols 20 | 21 | class CAirspaceConverterApp : public CWinApp { 22 | public: 23 | CAirspaceConverterApp(); 24 | 25 | // Overrides 26 | private: 27 | virtual BOOL InitInstance(); 28 | 29 | // Implementation 30 | DECLARE_MESSAGE_MAP() 31 | }; 32 | 33 | extern CAirspaceConverterApp theApp; 34 | -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 9/12/2017 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2017 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | if [ "$(uname)" == "Darwin" ]; then 14 | echo "Uninstalling everything from macOS ..." 15 | 16 | # Uninstall GUI 17 | cd macOS 18 | ./uninstall.sh 19 | cd .. 20 | 21 | # Uninstall shared library and CLI 22 | make uninstall 23 | elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then 24 | echo "Uninstalling everything from Linux ..." 25 | 26 | # Uninstall GUI 27 | sudo rm -f /usr/bin/airspaceconverter-gui 28 | 29 | # Uninstall shared library and CLI 30 | sudo make uninstall 31 | else 32 | echo "ERROR: this script is only for Linux or macOS ..." 33 | exit 1 34 | fi 35 | 36 | echo "AirspaceConverter full uninstallation done." -------------------------------------------------------------------------------- /test/processAir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 08/12/2017 5 | # Author : Valerio Messina 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2017 Valerio Messina 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | # 'processAir' process some test input files in .aip format and generate Openair files 13 | 14 | airspaceconverter -i openaip_airspace_ts.aip -o openair_airspace_ts.txt -p -s 15 | 16 | airspaceconverter -i openaip_airspace_sixty.aip -o openair_airspace_sixty.txt -p -s 17 | 18 | airspaceconverter -i Amendola.aip -o Amendola.txt -p -s 19 | 20 | airspaceconverter -i openaip_airspace_switzerland_ch.aip -o openair_airspace_ch.txt -p -s 21 | 22 | airspaceconverter -i openaip_airspace_italy_it.aip -o openair_airspace_it.txt -p -s 23 | 24 | airspaceconverter -i openaip_airspace_italy_it.aip -i openaip_airspace_switzerland_ch.aip -l 90,44.8,-180,180 -o openair_airspace_cli.txt -p -s 25 | -------------------------------------------------------------------------------- /Windows/AirspaceConverter/AirspaceConverter.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /macOS/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 18/2/2020 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2020 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Make sure that we are on macOS 14 | if [ "$(uname)" != "Darwin" ]; then 15 | echo "ERROR: this script is only for macOS ..." 16 | exit 1 17 | fi 18 | 19 | # First remove older version if present 20 | ./uninstall.sh 21 | 22 | # Build macOS application bundle if not yet done 23 | if [[ ! -d ./AirspaceConverter.app ]] 24 | then 25 | echo "Building macOS application bundle which was not yet done..." 26 | ./makeApp.sh 27 | fi 28 | 29 | # Install AirspaceConverter Qt GUI application ... 30 | echo "Installing AirspaceConverter GUI application ..." 31 | cp -r ./AirspaceConverter.app /Applications 32 | echo "MacOS application installation done." 33 | 34 | # Launch installed application 35 | open /Applications/AirspaceConverter.app 36 | -------------------------------------------------------------------------------- /test/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 08/12/2017 5 | # Author : Valerio Messina 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2017 Valerio Messina 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | # 'test' build, copy binaries and test Airspaces files in test dir, start GUI 13 | 14 | cd .. 15 | echo Compiling ... 16 | build.sh 17 | if (test "$?" != 0) then 18 | echo compile error 19 | exit 20 | fi 21 | echo Done 22 | echo Copying binaries ... 23 | cp Release/airspaceconverter test 24 | cp Release/libairspaceconverter.so test 25 | cp buildQt/airspaceconverter-gui test 26 | cd test 27 | echo Done 28 | echo Copying aip airspaces files ... 29 | cp ~/Documents/Flight/airspaces/aip_in/openaip_airspace_ts.aip . 30 | cp ~/Documents/Flight/airspaces/aip_in/Amendola.aip . 31 | cp ~/Documents/Flight/airspaces/aip_in/openaip_airspace_italy_it.aip . 32 | cp ~/Documents/Flight/airspaces/aip_in/openaip_airspace_switzerland_ch.aip . 33 | echo Done 34 | airspaceconverter-gui & 35 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 9/12/2017 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2017 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # First compile 14 | ./build.sh 15 | 16 | # Abort if build failed 17 | if [ "$?" -ne 0 ]; then 18 | exit 1 19 | fi 20 | 21 | if [ "$(uname)" == "Darwin" ]; then 22 | echo "Installing everything on macOS..." 23 | 24 | # Install shared library and CLI 25 | make install 26 | 27 | # Install GUI 28 | cd macOS 29 | ./install.sh 30 | cd .. 31 | elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then 32 | echo "Installing everything on Linux ..." 33 | 34 | # Install shared library and CLI 35 | sudo make install 36 | 37 | # Install GUI 38 | sudo cp ./Release/airspaceconverter-gui /usr/bin 39 | sudo chmod 0755 /usr/bin/airspaceconverter-gui 40 | else 41 | echo "ERROR: this script is only for Linux or macOS ..." 42 | exit 1 43 | fi 44 | 45 | echo "Full installation done." -------------------------------------------------------------------------------- /test/openairSort.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 08/12/2017 5 | # Author : Valerio Messina 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2017 Valerio Messina 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | # 'openairSort' sort openair airspaces, keep duplicates, v1.00 13 | 14 | fileIn1=$1 15 | fileOut=$2 16 | 17 | cp $fileIn1 tmp1.txt 18 | dos2unix -q tmp1.txt 19 | cat tmp1.txt | awk 'BEGIN{RS="\n\n" ; ORS="[";}{ print }' > tmp2.txt # 2xNewLine to [ 20 | cat tmp2.txt | tr '\n' ']' > tmp1.txt # 1xNewLine to ] 21 | cat tmp1.txt | tr '[' '\n' > tmp2.txt # [ to 1xNewLine 22 | cp tmp2.txt out.txt 23 | 24 | airIn=`wc -l out.txt | cut -d' ' -f1` 25 | echo airIn:$airIn airspaces 26 | cat out.txt | sort > tmp1.txt # sort 27 | airOut=`wc -l tmp1.txt | cut -d' ' -f1` 28 | echo airOut:$airOut airspaces 29 | 30 | cat tmp1.txt | awk 'BEGIN{RS="\n" ; ORS="\n\n";}{ print }' > tmp2.txt # 1xNewLine to 2xNewLine 31 | cat tmp2.txt | tr ']' '\n' > tmp1.txt # ] to 1xNewLine 32 | mv tmp1.txt $fileOut # output file 33 | rm tmp2.txt out.txt 34 | echo Note: Output file \"$fileOut\" has Unix newlines 35 | -------------------------------------------------------------------------------- /QtGUI/LimitsDialog.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 26/11/2017 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2017 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | 16 | namespace Ui { 17 | class LimitsDialog; 18 | } 19 | 20 | class Altitude; 21 | 22 | class LimitsDialog : public QDialog 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | explicit LimitsDialog(QWidget *parent = nullptr); 28 | ~LimitsDialog(); 29 | 30 | private slots: 31 | void on_buttonBox_accepted(); 32 | void on_filterOnAltitudeCheckBox_stateChanged(int checked); 33 | void on_filterOnPositionCheckBox_stateChanged(int checked); 34 | void on_unlimitedTopAltitudeCheckBox_stateChanged(int checked); 35 | 36 | private: 37 | Ui::LimitsDialog *ui; 38 | bool validLimits; 39 | 40 | signals: 41 | void validLimitsSet(bool validAreaLimits, const double& topLat, const double& bottomLat, const double& leftLon, const double& rightLon, bool validAltLimits, const Altitude& floor, const Altitude& ceil); 42 | }; 43 | -------------------------------------------------------------------------------- /src/Waypoint.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #include "Waypoint.hpp" 14 | #include 15 | 16 | const std::string Waypoint::TYPE_NAMES[] = { 17 | "UNDEFINED", 18 | "Normal", 19 | "Airfield grass", 20 | "Outlanding", 21 | "Glider site", 22 | "Airfield solid", 23 | "Mount pass", 24 | "Mount top", 25 | "Antenna", 26 | "VOR", 27 | "NDB", 28 | "Cool tower", 29 | "Dam", 30 | "Tunnel", 31 | "Bridge", 32 | "Power plant", 33 | "Castle", 34 | "Intersection" 35 | }; 36 | 37 | Waypoint::Waypoint(const std::string& longName, const std::string& shortName, const std::string& countryCode, const double lat, const double lon, const float alt, const int style, const std::string& descr) 38 | : pos(lat,lon) 39 | , name(longName) 40 | , code(shortName) 41 | , country(countryCode) 42 | , altitude(alt) 43 | , type((WaypointType)style) 44 | , otherFreq(0) 45 | , description(descr) { 46 | assert(pos.IsValid()); 47 | } 48 | -------------------------------------------------------------------------------- /src/Airfield.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #include "Airfield.hpp" 14 | #include 15 | 16 | Airfield::Airfield(const std::string& longName, const std::string& shortName, const std::string& countryCode, const double lat, const double lon, const float alt, const int style, const int rwyDir, const int rwyLen, const int freq, const std::string& descr) 17 | : Waypoint(longName, shortName, countryCode, lat, lon, alt, style, descr) 18 | , runwayDir(rwyDir) 19 | , runwayLength(rwyLen) 20 | , radioFreq(freq) { 21 | assert(IsAirfield()); 22 | } 23 | 24 | Airfield::Airfield(const std::string& longName, const std::string& shortName, const std::string& countryCode, const double lat, const double lon, const float alt, const int style, const std::string& descr) 25 | : Waypoint(longName, shortName, countryCode, lat, lon, alt, style, descr) 26 | , runwayDir(-1) 27 | , runwayLength(-1) 28 | , radioFreq(-1) { 29 | assert(IsAirfield()); 30 | } 31 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/Processor.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #define WM_GENERAL_WORK_DONE WM_USER+1 20 | 21 | class AirspaceConverter; 22 | 23 | class Processor { 24 | public: 25 | Processor(HWND hwnd, AirspaceConverter* airspaceConverter); 26 | ~Processor(); 27 | bool LoadAirspacesFiles(const double& QNH); 28 | bool LoadDEMfiles(); 29 | bool LoadWaypointsFiles(); 30 | bool Convert(); 31 | inline void SetWindow(HWND hwnd) { window = hwnd; } 32 | inline void Join() { if (workerThread.joinable()) workerThread.join(); } 33 | 34 | private: 35 | bool cGPSmapper(const std::string& polishFile, const std::string& outputFile) const; 36 | void LoadAirspacesFilesThread(); 37 | void LoadWaypointsFilesThread(); 38 | void LoadDEMfilesThread(); 39 | void ConvertThread(); 40 | 41 | HWND window; 42 | std::thread workerThread; 43 | AirspaceConverter* converter; 44 | }; 45 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Pull Request Template 2 | 3 | ## Description 4 | 5 | Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. 6 | 7 | Fixes #(issue) 8 | 9 | ## Type of change 10 | 11 | Please delete options that are not relevant. 12 | 13 | - [ ] Bug fix (non-breaking change which fixes an issue) 14 | - [ ] New feature (non-breaking change which adds functionality) 15 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 16 | - [ ] This change requires a documentation update 17 | 18 | ## How Has This Been Tested? 19 | 20 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. 21 | 22 | - [ ] Test A 23 | - [ ] Test B 24 | 25 | **Test Configuration**: 26 | * Firmware version: 27 | * Hardware: 28 | * Toolchain: 29 | * SDK: 30 | 31 | ## Checklist: 32 | 33 | - [ ] My code follows the style guidelines of this project 34 | - [ ] I have performed a self-review of my own code 35 | - [ ] I have commented my code, particularly in hard-to-understand areas 36 | - [ ] I have made corresponding changes to the documentation 37 | - [ ] My changes generate no new warnings 38 | - [ ] I have added tests that prove my fix is effective or that my feature works 39 | - [ ] New and existing unit tests pass locally with my changes 40 | - [ ] Any dependent changes have been merged and published in downstream modules -------------------------------------------------------------------------------- /macOS/crossBuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # crossBuild.sh V0.02.00 2023/04/13 Copyright (C) 2021 Valerio Messina 3 | # License : GNU GPL v3 4 | # cross-build AirspaceConverter from Linux to macOS 5 | # Note: For the thing to work it is necessary to install 'osxcross' 6 | # and need to be exported the env vars: 7 | # $(OCROSS) cross-compiler tools prefix, eg. x86_64-apple-darwin18- 8 | # $(OSXROOT) point to cross-compiler root path, eg. /opt/osxcross 9 | # $(OSXDEPS) point to $(OSXROOT)/target/macports 10 | # Note: $(OSXROOT)/target/bin must be in PATH to find $(OCROSS) 11 | # 12 | echo "crossBuild.sh V0.02.00 2023/04/13 Copyright (C) 2023 Valerio Messina" 13 | cd .. 14 | mkdir -p buildQt 15 | cp macOS/Makefile.darwin-clang++ . 16 | cp macOS/MakefileGui.darwin-clang++ buildQt 17 | echo "CrossBuilding CLI and LIB ..." 18 | make -f Makefile.darwin-clang++ 19 | echo "" 20 | cd buildQt 21 | cp -a MakefileGui.darwin-clang++ Makefile 22 | echo "CrossBuilding GUI ..." 23 | make -f MakefileGui.darwin-clang++ 24 | cp airspaceconverter-gui ../Release 25 | 26 | # Note: once cross-built, to generate a compressed DMG on Linux, compile 'dmg' then: 27 | # AirspaceConverter$ cp macOS/AirspaceConverter.icns Release/osxcross-dmg.icns 28 | # AirspaceConverter$ cd Release 29 | # AirspaceConverter/Release$ ../macOS/osxcross-dmg airspaceconverter AirspaceConverter 30 | # AirspaceConverter/Release$ ../macOS/osxcross-dmg airspaceconverter-gui AirspaceConverter 31 | # 32 | # when asked, customize Info.plist, copy PNGs from 'icons' in: 33 | # Release/DiskImage/AirspaceConverter.app/Contents/Resources/icons/ 34 | -------------------------------------------------------------------------------- /src/SeeYou.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | #include 16 | 17 | class Waypoint; 18 | 19 | class SeeYou { 20 | 21 | public: 22 | SeeYou(std::multimap& waypointsMap); 23 | ~SeeYou() {} 24 | bool Read(const std::string& fileName); 25 | bool Write(const std::string& fileName); 26 | 27 | private: 28 | static bool ParseLatitude(const std::string& text, double& lat); 29 | static bool ParseLongitude(const std::string& text, double& lon); 30 | static bool ParseAltitude(const std::string& text, float& alt); 31 | static bool ParseStyle(const std::string& text, int& type); 32 | static bool ParseRunwayDir(const std::string& text, int& dir); 33 | static bool ParseRunwayLength(const std::string& text, int& length); 34 | static bool ParseAirfieldFrequencies(const std::string& text, int& mainFreqHz, int& secondaryFreqHz); 35 | static bool ParseOtherFrequency(const std::string& text, const int type, int& freqHz); 36 | 37 | static const std::string defaultHeader; 38 | std::multimap& waypoints; 39 | }; 40 | -------------------------------------------------------------------------------- /src/CSV.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Authors : Valerio Messina 5 | // Alberto Realis-Luc 6 | // Web : https://www.alus.it/AirspaceConverter 7 | // Repository : https://github.com/alus-it/AirspaceConverter.git 8 | // Copyright : (C) 2016 Valerio Messina, Alberto Realis-Luc 9 | // License : GNU GPL v3 10 | // 11 | // This source file is part of AirspaceConverter project 12 | //============================================================================ 13 | 14 | #pragma once 15 | #include 16 | #include 17 | 18 | class Waypoint; 19 | 20 | class CSV { 21 | 22 | public: 23 | CSV(std::multimap& waypointsMap); 24 | ~CSV() {} 25 | bool Read(const std::string& fileName); 26 | bool Write(const std::string& fileName); 27 | 28 | private: 29 | static bool ParseLatitude(const std::string& text, double& lat); 30 | static bool ParseLongitude(const std::string& text, double& lon); 31 | static bool ParseAltitude(const std::string& text, float& alt); 32 | static bool ParseStyle(const std::string& text, int& type); 33 | static bool ParseRunwayDir(const std::string& text, int& dir); 34 | static bool ParseRunwayLength(const std::string& text, int& length); 35 | static bool ParseAirfieldFrequencies(const std::string& text, int& mainFreqHz, int& secondaryFreqHz); 36 | static bool ParseOtherFrequency(const std::string& text, const int type, int& freqHz); 37 | 38 | std::multimap& waypoints; 39 | }; 40 | -------------------------------------------------------------------------------- /macOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleName 6 | AirspaceConverter 7 | CFBundleExecutable 8 | airspaceconverter-gui 9 | CFBundleIdentifier 10 | it.alus.airspaceconverter 11 | CFBundleIconFile 12 | AirspaceConverter.icns 13 | CFBundleVersion 14 | 0.3.8 15 | CFBundleShortVersionString 16 | 0.3.8 17 | CFBundleSupportedPlatforms 18 | 19 | MacOSX 20 | 21 | CFBundlePackageType 22 | APPL 23 | CFBundleDevelopmentRegion 24 | en 25 | CFBundleInfoDictionaryVersion 26 | 6.0 27 | CFBundleGetInfoString 28 | Created by makeApp.sh script by Alberto Realis-Luc 29 | CFBundleSignature 30 | ???? 31 | LSMinimumSystemVersion 32 | 10.15 33 | NSPrincipalClass 34 | NSApplication 35 | NSSupportsAutomaticGraphicsSwitching 36 | 37 | NSHumanReadableCopyright 38 | Copyright© 2016 Alberto Realis-Luc. All rights reserved. alus.it/AirspaceConverter 39 | NSMainStoryboardFile 40 | Main 41 | NSSupportsAutomaticTermination 42 | 43 | NSSupportsSuddenTermination 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/Airfield.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include "Waypoint.hpp" 15 | 16 | class Airfield: public Waypoint { 17 | public: 18 | Airfield(const std::string& longName, const std::string& shortName, const std::string& countryCode, const double lat, const double lon, const float alt, const int style, const int rwyDir, const int rwyLen, const int freq, const std::string& descr); 19 | Airfield(const std::string& longName, const std::string& shortName, const std::string& countryCode, const double lat, const double lon, const float alt, const int style, const std::string& descr); 20 | ~Airfield() {} 21 | 22 | inline int GetRunwayDir() const { return runwayDir; } 23 | inline int GetRunwayLength() const { return runwayLength; } 24 | inline int GetRadioFrequency() const { return radioFreq; } 25 | inline bool HasRunwayDir() const { return runwayDir > 0; } 26 | inline bool HasRunwayLength() const { return runwayLength > 0; } 27 | inline bool HasRadioFrequency() const { return radioFreq > 0; } 28 | 29 | private: 30 | int runwayDir; // [deg] 31 | int runwayLength; // [m] 32 | int radioFreq; // [Hz] 33 | 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /test/check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 08/12/2017 5 | # Author : Valerio Messina 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2017 Valerio Messina 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | # 'check' sort Openair test files and compare. Depend on 'openairSort' 13 | 14 | fileIn=openair_airspace_ts.txt 15 | fileIn=openair_airspace_sixty.txt 16 | fileIn=Amendola.txt 17 | fileIn=openair_airspace_ch.txt 18 | fileIn=openair_airspace_it.txt 19 | fileIn=openair_airspace_cli.txt 20 | fileOut=openair_airspace_check.txt 21 | 22 | comp=opentxt_airspace_switzerland_ch.txt 23 | comp=opentxt_airspace_italy_it.txt 24 | comp=opentxt_airspace_lat.txt 25 | 26 | cp $fileIn t0.txt 27 | dos2unix -q t0.txt 28 | cat t0.txt | sed 's/\([[:digit:]]\) FT /\1F /g' > t1.txt 29 | cat t1.txt | sed 's/ AMSL$/ MSL$/g' > t2.txt 30 | cat t2.txt | sed 's/F AGL$/F GND$/g' > t3.txt 31 | perl -0777 -pe 's/\n(AL .*)\n(AH .*)\n/\n\2\n\1\n/g' t3.txt > t4.txt 32 | #unix2dos -q t4.txt 33 | cp t4.txt $fileOut 34 | rm t0.txt t1.txt t2.txt t3.txt t4.txt 35 | openairSort openair_airspace_check.txt openair_0.2.6_sorted.txt 36 | 37 | cp ~/Documents/Flight/airspaces/openair_out/$comp . 38 | cat $comp | sed 's/^AC X$/AC G/g' > t0.txt 39 | mv t0.txt $comp 40 | openairSort $comp opentxt_php_sorted.txt 41 | 42 | diff opentxt_php_sorted.txt openair_0.2.6_sorted.txt > diff.txt 43 | ne opentxt_php_sorted.txt openair_0.2.6_sorted.txt diff.txt 44 | -------------------------------------------------------------------------------- /macOS/makeZip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 17/2/2020 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2020 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Make sure that we are on macOS 14 | if [ "$(uname)" != "Darwin" ]; then 15 | echo "ERROR: this script is only for macOS ..." 16 | exit 1 17 | fi 18 | 19 | # First clean older files 20 | rm -rf AirspaceConverter*.zip 21 | 22 | # Build macOS application bundle if not yet done 23 | if [[ ! -d ./AirspaceConverter.app ]] 24 | then 25 | echo "Building macOS application bundle which was not yed done..." 26 | ./makeApp.sh 27 | fi 28 | 29 | # Get version number, try from the sources (sources should be present) 30 | VERSION="$(grep -s "define VERSION" ../src/AirspaceConverter.hpp | awk -F\" '{print $2}')" 31 | 32 | # If no valid version number, then ask the user 33 | if [[ "$VERSION" =~ [0-9].[0-9].[0-9] ]]; then 34 | echo "Detected AirspaceConverter version: ${VERSION}" 35 | else 36 | printf "Enter new airspaceconverter version: " 37 | read -r VERSION 38 | fi 39 | 40 | # Remove the dots from the version string 41 | IFS='.' 42 | arr=($VERSION) 43 | VER="${arr[0]]}${arr[1]]}${arr[2]]}" 44 | 45 | # Create distribution ZIP file 46 | echo "Building distribution ZIP file ..." 47 | zip -9 -T -r AirspaceConverter${VER}.zip AirspaceConverter.app/ 48 | 49 | echo "Distribution ZIP file: AirspaceConverter${VER}.zip done." 50 | -------------------------------------------------------------------------------- /QtGUI/AboutDialog.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #include "AboutDialog.hpp" 14 | #include "ui_AboutDialog.h" 15 | #include "AirspaceConverter.hpp" 16 | 17 | AboutDialog::AboutDialog(QWidget *parent) : 18 | QDialog(parent), 19 | ui(new Ui::AboutDialog) { 20 | ui->setupUi(this); 21 | ui->versionLabel->setText(VERSION); 22 | ui->compileDateLabel->setText(QString("Compiled on %1 at %2").arg(__DATE__).arg(__TIME__)); 23 | } 24 | 25 | AboutDialog::~AboutDialog() { 26 | delete ui; 27 | } 28 | 29 | void AboutDialog::show() { 30 | 31 | // Perform the version check 32 | ui->newVersionLabel->clear(); 33 | int diffLatestVersion; 34 | if (AirspaceConverter::CheckForNewVersion(diffLatestVersion)) { 35 | if (diffLatestVersion == 0) ui->newVersionLabel->setText("Congratulations: this is the latest version."); 36 | else if (diffLatestVersion > 0) { 37 | QPalette palette = ui->newVersionLabel->palette(); 38 | palette.setColor(ui->newVersionLabel->foregroundRole(), Qt::red); 39 | ui->newVersionLabel->setPalette(palette); 40 | ui->newVersionLabel->setText("A new version is available! Check our website."); 41 | AirspaceConverter::LogWarning("A new version is available! Please update."); 42 | } 43 | else ui->newVersionLabel->setText("This version is not yet released."); 44 | } 45 | 46 | // Then show the dialog 47 | QDialog::show(); 48 | } 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #============================================================================ 2 | # AirspaceConverter 3 | # Since : 14/6/2016 4 | # Author : Alberto Realis-Luc 5 | # Web : https://www.alus.it/AirspaceConverter 6 | # Repository : https://github.com/alus-it/AirspaceConverter.git 7 | # Copyright : (C) 2016 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This source file is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Compiled Object files 14 | *.slo 15 | *.lo 16 | *.o 17 | *.obj 18 | *.a 19 | *.so 20 | *.so.* 21 | 22 | # Precompiled Headers 23 | *.gch 24 | *.pch 25 | 26 | # Compiled Dynamic libraries 27 | *.so 28 | *.dylib 29 | *.dll 30 | 31 | # Compiled Static libraries 32 | *.lai 33 | *.la 34 | *.a 35 | *.lib 36 | 37 | # Executables 38 | *.exe 39 | *.out 40 | *.app 41 | QtGUI/airspaceconverter-gui 42 | 43 | # Installation files 44 | *.deb 45 | *.msi 46 | *.dmg 47 | 48 | # Archives 49 | *.zip 50 | *.tar 51 | *.gz 52 | 53 | # Ignore bin and build folders 54 | bin 55 | Debug 56 | Release 57 | */Debug 58 | */Release 59 | */*/Debug 60 | */*/Release 61 | build-* 62 | buildQt 63 | QtGUI-build* 64 | 65 | # Ignore Eclipse project files 66 | .project 67 | .cproject 68 | .settings/* 69 | 70 | # Visual studio stuff 71 | Windows/.vs 72 | Windows/packages 73 | Windows/ipch 74 | *.aps 75 | *.idb 76 | *.ipch 77 | *.lastbuildstate 78 | *.log 79 | *.manifest 80 | *.pdb 81 | *.res 82 | *.sdf 83 | *.suo 84 | *.tlog 85 | *.db 86 | *.opendb 87 | *.tmp 88 | *.cache 89 | 90 | # Visual Studio Code stuff 91 | .vscode/* 92 | 93 | # Generated readme 94 | Windows/Readme.rtf 95 | 96 | # Qt Creator stuff 97 | *.user 98 | *.pro.user.* 99 | QtGUI/.qtc_clangd/* 100 | QtGUI/ui_*.h 101 | QtGUI/moc_*.h 102 | QtGUI/moc_*.cpp 103 | QtGUI/Makefile 104 | QtGUI/qrc_resources.cpp 105 | -------------------------------------------------------------------------------- /macOS/makeDmg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 17/2/2020 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2020 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Make sure that we are on macOS 14 | if [ "$(uname)" != "Darwin" ]; then 15 | echo "ERROR: this script is only for macOS ..." 16 | exit 1 17 | fi 18 | 19 | # First clean older files 20 | rm -rf AirspaceConverter*.dmg 21 | 22 | # Build macOS application bundle if not yet done 23 | if [[ ! -d ./AirspaceConverter.app ]] 24 | then 25 | echo "Building macOS application bundle which was not yed done..." 26 | ./makeApp.sh 27 | fi 28 | 29 | # Get version number, try from the sources (sources should be present) 30 | VERSION="$(grep -s "define VERSION" ../src/AirspaceConverter.hpp | awk -F\" '{print $2}')" 31 | 32 | # If no valid version number, then ask the user 33 | if [[ "$VERSION" =~ [0-9].[0-9].[0-9] ]]; then 34 | echo "Detected AirspaceConverter version: ${VERSION}" 35 | else 36 | printf "Enter new airspaceconverter version: " 37 | read -r VERSION 38 | fi 39 | 40 | # Remove the dots from the version string 41 | IFS='.' 42 | arr=($VERSION) 43 | VER="${arr[0]]}${arr[1]]}${arr[2]]}" 44 | 45 | # Create distribution DMG disk image 46 | echo "Building DMG disk image ..." 47 | mkdir DiskImage 48 | mv ./AirspaceConverter.app ./DiskImage/ 49 | hdiutil create ./DiskImage.dmg -ov -volname "AirspaceConverter" -fs HFS+ -srcfolder "./DiskImage/" 50 | echo "Compressing DMG disk image ..." 51 | hdiutil convert ./DiskImage.dmg -format UDZO -o AirspaceConverter${VER}.dmg 52 | rm DiskImage.dmg 53 | mv ./DiskImage/AirspaceConverter.app ./ 54 | rm -r DiskImage 55 | 56 | echo "Distribution disk image: AirspaceConverter${VER}.dmg done." 57 | -------------------------------------------------------------------------------- /test/tstCsv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 07/09/2020 5 | # Author : Valerio Messina 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2020 Valerio Messina 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | # 'tstCsv' check the CSV in/out comparing to a reference generated with CUP2CSV bash script 13 | 14 | cd .. 15 | echo Compiling ... 16 | build.sh 17 | if (test "$?" != 0) then 18 | echo compile error 19 | exit 20 | fi 21 | echo Done 22 | cd Release 23 | echo "" 24 | 25 | echo Testing CUP2CSV ... 26 | #airspaceconverter -w ~/Documents/Flight/AIP/tst.cup -o ~/Documents/Flight/AIP/tst.csv 27 | airspaceconverter -w ~/Documents/Flight/AIP/ITA_WPT_10-SEP-2020-2010_V03.cup -o ~/Documents/Flight/AIP/tst.csv 28 | echo -en "\e[1A" # cursor up 1 line 29 | echo Sorting ... 30 | sort ~/Documents/Flight/AIP/tst.csv > ~/Documents/Flight/AIP/tst1.csv 31 | mv ~/Documents/Flight/AIP/tst1.csv ~/Documents/Flight/AIP/tst.csv 32 | echo Comparing ... 33 | #diff --strip-trailing-cr ~/Documents/Flight/AIP/ref.csv ~/Documents/Flight/AIP/tst.csv > ~/Documents/Flight/AIP/diff.txt 34 | diff --strip-trailing-cr ~/Documents/Flight/AIP/ITA_WPT_10-SEP-2020-2010_V03.csv ~/Documents/Flight/AIP/tst.csv > ~/Documents/Flight/AIP/diff.txt 35 | if (! test -s ~/Documents/Flight/AIP/diff.txt) then 36 | echo OK 37 | fi 38 | echo "" 39 | 40 | echo Testing CSV2CUP ... 41 | airspaceconverter -w ~/Documents/Flight/AIP/tst2.csv -o ~/Documents/Flight/AIP/tst2.cup 42 | echo -en "\e[1A" # cursor up 1 line 43 | echo "" 44 | 45 | echo Testing CSV2CSV ... 46 | airspaceconverter -w ~/Documents/Flight/AIP/tst2.csv -o ~/Documents/Flight/AIP/tst3.csv 47 | echo -en "\e[1A" # cursor up 1 line 48 | echo Sorting ... 49 | sort ~/Documents/Flight/AIP/tst3.csv > ~/Documents/Flight/AIP/tst4.csv 50 | mv ~/Documents/Flight/AIP/tst4.csv ~/Documents/Flight/AIP/tst3.csv 51 | -------------------------------------------------------------------------------- /src/OpenAIP.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | #include 16 | #include 17 | 18 | class Airspace; 19 | class Waypoint; 20 | class Altitude; 21 | 22 | class OpenAIP { 23 | 24 | public: 25 | OpenAIP(std::multimap& airspacesMap, std::multimap& waypointsMap); 26 | ~OpenAIP() {} 27 | bool ReadAirspaces(const std::string& fileName); 28 | bool ReadWaypoints(const std::string& fileName); 29 | 30 | private: 31 | static bool ParseAltitude(const boost::property_tree::ptree& node, Altitude& altitude); 32 | static bool ParseGeolocation(const boost::property_tree::ptree& parentNode, double &lat, double &lon, double &alt); 33 | static bool ParseContent(const boost::property_tree::ptree& parentNode, const std::string& tagName, std::string& outputString); 34 | static bool ParseAttribute(const boost::property_tree::ptree& node, const std::string& attributeName, std::string& outputString); 35 | static bool ParseValue(const boost::property_tree::ptree& parentNode, const std::string& tagName, double &value); 36 | static bool ParseMeasurement(const boost::property_tree::ptree& parentNode, const std::string& tagName, char expectedUnit, double &value); 37 | 38 | bool ParseAirports(const boost::property_tree::ptree& airportsNode); 39 | bool ParseNavAids(const boost::property_tree::ptree& navAidsNode); 40 | //bool ParseHotSpots(const boost::property_tree::ptree& hotSpotsNode); 41 | 42 | std::multimap& airspaces; 43 | std::multimap& waypoints; 44 | }; 45 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/AirspaceConverterApp.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #include "stdafx.h" 14 | #include "AirspaceConverterApp.hpp" 15 | #include "AirspaceConverterDlg.hpp" 16 | 17 | #ifdef _DEBUG 18 | #define new DEBUG_NEW 19 | #endif 20 | 21 | // CAirspaceConverterApp 22 | BEGIN_MESSAGE_MAP(CAirspaceConverterApp, CWinApp) 23 | ON_COMMAND(ID_HELP, &CWinApp::OnHelp) 24 | END_MESSAGE_MAP() 25 | 26 | CAirspaceConverterApp::CAirspaceConverterApp() { 27 | // Add construction code here, 28 | // Place all significant initialization in InitInstance 29 | } 30 | 31 | // The one and only CAirspaceConverterApp object 32 | CAirspaceConverterApp theApp; 33 | 34 | // CAirspaceConverterApp initialization 35 | BOOL CAirspaceConverterApp::InitInstance() { 36 | CWinApp::InitInstance(); 37 | 38 | // Call AfxInitRichEdit2() to initialize richedit2 library. 39 | AfxInitRichEdit(); 40 | 41 | // Standard initialization 42 | // If you are not using these features and wish to reduce the size 43 | // of your final executable, you should remove from the following 44 | // the specific initialization routines you do not need 45 | // Change the registry key under which our settings are stored 46 | SetRegistryKey(_T("Local AirspaceConverter Applications")); 47 | 48 | CAirspaceConverterDlg dlg; 49 | m_pMainWnd = &dlg; 50 | INT_PTR nResponse = dlg.DoModal(); 51 | /*if (nResponse == IDOK) {} // dismissed with OK 52 | else if (nResponse == IDCANCEL) {} // dismissed with Cancel 53 | else*/ 54 | if (nResponse == -1) TRACE(traceAppMsg, 0, "Warning: dialog creation failed, so application is terminating unexpectedly.\n"); 55 | 56 | // Since the dialog has been closed, return FALSE so that we exit the application, rather than start the application's message pump. 57 | return FALSE; 58 | } 59 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/LimitsDlg.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 1/12/2017 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2017 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include "afxwin.h" 15 | #include "Altitude.hpp" 16 | 17 | class CLimitsDlg : public CDialog { 18 | public: 19 | CLimitsDlg(); 20 | 21 | // Dialog Data 22 | #ifdef AFX_DESIGN_TIME 23 | enum { IDD = IDD_LIMITS_DIALOG }; 24 | #endif 25 | 26 | inline double GetTopLatLimit() const { return northLatLimit; } 27 | inline double GetBottomLatLimit() const { return southLatLimit; } 28 | inline double GetLeftLonLimit() const { return westLonLimit; } 29 | inline double GetRightLonLimit() const { return eastLonLimit; } 30 | inline bool HasValidAreaLimits() const { return validAreaLimitsSet; } 31 | inline const Altitude& GetTopAltitude() const { return topAltitude; } 32 | inline const Altitude& GetLowAltitude() const { return lowAltitude; } 33 | inline bool HasValidAltitudeLimits() const { return validAltitudeLimitsSet; } 34 | 35 | protected: 36 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 37 | virtual void OnOK(); 38 | 39 | private: 40 | DECLARE_MESSAGE_MAP() 41 | virtual BOOL OnInitDialog(); 42 | afx_msg void OnBnClickedCheckUnlimitedAltLimit(); 43 | afx_msg void OnBnClickedCheckFilterOnAltitude(); 44 | afx_msg void OnBnClickedCheckFilterOnArea(); 45 | 46 | double northLatLimit; 47 | double southLatLimit; 48 | double eastLonLimit; 49 | double westLonLimit; 50 | bool validAreaLimitsSet; 51 | Altitude topAltitude; 52 | Altitude lowAltitude; 53 | bool validAltitudeLimitsSet; 54 | CButton filterOnAreaCheckbox; 55 | CButton filterOnAltitudeCheckbox; 56 | CButton unlimitedTopAltitudeCheckbox; 57 | CComboBox topAltitudeUnitCombo; 58 | CComboBox lowAltitudeUnitCombo; 59 | CEdit northLatLimitEdit; 60 | CEdit southLatLimitEdit; 61 | CEdit eastLonLimitEdit; 62 | CEdit westLonLimitEdit; 63 | CEdit topAltitudeEdit; 64 | CEdit lowAltitudeEdit; 65 | }; 66 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/stdafx.h: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | // stdafx.h : include file for standard system include files, 14 | // or project specific include files that are used frequently, 15 | // but are changed infrequently 16 | 17 | #pragma once 18 | 19 | #ifndef VC_EXTRALEAN 20 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 21 | #endif 22 | 23 | #include "targetver.h" 24 | 25 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 26 | #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS // remove support for MFC controls in dialogs 27 | 28 | // turns off MFC's hiding of some common and often safely ignored warning messages 29 | #define _AFX_ALL_WARNINGS 30 | 31 | #include // MFC core and standard components 32 | #include // MFC extensions 33 | 34 | 35 | #ifndef _AFX_NO_OLE_SUPPORT 36 | #include // MFC support for Internet Explorer 4 Common Controls 37 | #endif 38 | #ifndef _AFX_NO_AFXCMN_SUPPORT 39 | #include // MFC support for Windows Common Controls 40 | #endif // _AFX_NO_AFXCMN_SUPPORT 41 | 42 | #include // MFC support for ribbons and control bars 43 | 44 | 45 | #ifdef _UNICODE 46 | #if defined _M_IX86 47 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 48 | #elif defined _M_X64 49 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 50 | #else 51 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 52 | #endif 53 | #endif 54 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: GitHub Actions CI Linux build 2 | run-name: ${{ github.actor }} use GitHub Actions for CI Linux build 3 | on: [push] 4 | jobs: 5 | GitHub-Actions-CI-build: 6 | runs-on: ubuntu-latest 7 | permissions: 8 | contents: write 9 | steps: 10 | - run: | 11 | echo "Repository: ${{ github.repository }}, branch: ${{ github.ref }}" 12 | - run: | 13 | echo "Running on: ${{ runner.os }}, triggered by: ${{ github.event_name }}" 14 | # - name: Update distro 15 | # run: sudo apt update 16 | # - name: Upgrade distro 17 | # run: sudo apt upgrade 18 | - name: Install deps 19 | run: sudo apt install libzstd-dev libzip-dev libboost1.83-dev libboost-system1.83-dev libboost-filesystem1.83-dev libboost-locale1.83-dev qtbase5-dev ; 20 | sudo apt install 7zip grep tar wget 21 | - name: Check out code 22 | uses: actions/checkout@v4 23 | - name: Build CI Linux bin 24 | run: ./build.sh 25 | - name: Build CI Linux pkg 26 | run: ./makeAppImage.sh -y 27 | - name: List bin/pkg files 28 | run: pwd ; 29 | ls -l ${{ github.workspace }} ; 30 | ls -l ${{ github.workspace }}/Release 31 | - name: Get date 32 | run: | 33 | export DATE=$(date -I) 34 | echo "DATE: '${DATE}'" 35 | echo "DATE=${DATE}" >> $GITHUB_ENV 36 | - name: Reset ci-latest tag 37 | env: 38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 | DATE: ${{ env.DATE }} 40 | run: | 41 | git config --global user.email "ci@github.com" 42 | git config --global user.name "Github CI" 43 | git tag -d ci-latest || true 44 | git push origin :ci-latest || true 45 | git tag -m ci-latest ci-latest 46 | git push --tags 47 | echo "DATE: '${DATE}'" 48 | - name: Create CI rel 49 | id: create_release 50 | uses: ncipollo/release-action@v1.18.0 51 | env: 52 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 53 | with: 54 | allowUpdates: true 55 | draft: false 56 | name: CI Build 57 | tag: ci-latest 58 | prerelease: true 59 | replacesArtifacts: true 60 | artifacts: " 61 | AirspaceConverter*_Linux_x86_64_64bit.AppImage 62 | " 63 | - run: | 64 | echo "End status: ${{ job.status }}" 65 | -------------------------------------------------------------------------------- /src/RasterMap.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc, LK8000 team 8 | // License : GNU GPL v3 9 | // 10 | // The source code in this file was adopted from LK8000 project 11 | // 12 | // LK8000 Tactical Flight Computer - WWW.LK8000.IT 13 | // Released under GNU/GPL License v.2 14 | // See CREDITS.TXT file in LK8000 project for authors and copyrights 15 | // LK8000 Repository: https://github.com/LK8000/LK8000.git 16 | // 17 | //============================================================================ 18 | 19 | #pragma once 20 | #include 21 | #include 22 | 23 | class RasterMap final { 24 | public: 25 | typedef struct _TERRAIN_INFO 26 | { 27 | double Left; 28 | double Right; 29 | double Top; 30 | double Bottom; 31 | double StepSize; 32 | uint32_t Rows; 33 | uint32_t Columns; 34 | } TERRAIN_INFO; 35 | 36 | RasterMap(); 37 | ~RasterMap(); 38 | inline bool isMapLoaded() const { return terrain_valid; } 39 | bool GetMapCenter(double *lon, double *lat) const; 40 | inline double GetStepSize() const { return TerrainInfo.StepSize; } 41 | inline double GetTop() const { return TerrainInfo.Top; } 42 | inline double GetBottom() const { return TerrainInfo.Bottom; } 43 | //int GetEffectivePixelSize(double *pixel_D, double latitude, double longitude) const; // accurate method 44 | void SetFieldRounding(double xr, double yr); 45 | bool GetTerrainHeight(const double& Latitude, const double& Longitude, short& terrainHeight) const; 46 | bool Open(const std::string& filename); 47 | void Close(); 48 | //void Lock(); 49 | //void Unlock(); 50 | inline bool IsDirectAccess(void) const { return DirectAccess; }; 51 | inline bool IsPaged(void) const { return Paged; }; 52 | bool PointIsInTerrainRange(const double& latitude, const double& longitude) const; 53 | 54 | private: 55 | bool GetFieldAtXY(unsigned int lx, unsigned int ly, short& result) const; 56 | bool terrain_valid; 57 | short max_field_value; 58 | TERRAIN_INFO TerrainInfo; 59 | int xlleft; 60 | int xlltop; 61 | bool DirectFine; 62 | bool DirectAccess; 63 | bool Paged; 64 | double fXrounding, fYrounding; 65 | double fXroundingFine, fYroundingFine; 66 | int Xrounding, Yrounding; 67 | short* TerrainMem; 68 | }; 69 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/AirspaceConverterMFC.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 10 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | Source Files 48 | 49 | 50 | Source Files 51 | 52 | 53 | 54 | 55 | Resource Files 56 | 57 | 58 | 59 | 60 | 61 | Resource Files 62 | 63 | 64 | 65 | 66 | Resource Files 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/Altitude.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | 16 | class Altitude { 17 | public: 18 | Altitude(); 19 | Altitude(const double value, bool isInMeters = false, bool isMSL = true); 20 | Altitude(const int FL); 21 | 22 | inline void SetAltFt(const int ft, const bool isAMSL = true) { refIsMsl = isAMSL; altMt = ft*FEET2METER; altFt = ft; fl = 0; isUnlimited = false; } 23 | inline void SetAltMt(const double mt, const bool isAMSL = true) { refIsMsl = isAMSL; altFt = (int)(mt / FEET2METER); altMt = mt; fl = 0; isUnlimited = false; } 24 | void SetFlightLevel(const int FL); 25 | inline void SetGND() { refIsMsl = false; altMt = 0; altFt = 0; fl = 0; isUnlimited = false; } 26 | inline void SetUnlimited(bool unlimited = true) { if (unlimited) SetFlightLevel(600); isUnlimited = unlimited; } 27 | inline bool IsAMSL() const { return refIsMsl; } 28 | inline bool IsAGL() const { return !refIsMsl; } 29 | inline bool IsFL() const { return fl != 0; } 30 | inline bool IsUnlimited() const { return isUnlimited; } 31 | inline int GetAltFt() const { return altFt; } 32 | inline double GetAltMt() const { return altMt; } 33 | inline bool IsGND() const { return !refIsMsl && altFt == 0; } 34 | inline bool IsMSL() const { return refIsMsl && altFt == 0; } 35 | bool operator<(const Altitude& other) const; 36 | bool operator>(const Altitude& other) const; 37 | bool operator>=(const Altitude& other) const; 38 | bool operator<=(const Altitude& other) const; 39 | bool operator==(const Altitude& other) const; 40 | bool operator!=(const Altitude& other) const; 41 | 42 | const std::string ToString() const; 43 | inline static void SetQNH(const double QNHmb) { QNH = QNHmb; } 44 | inline static double GetQNH() { return QNH; } 45 | static const double FEET2METER; 46 | 47 | private: 48 | static double QNEaltitudeToStaticPressure(const double alt); 49 | static double StaticPressureToQNHaltitude(const double ps); 50 | static double QNEaltitudeToQNHaltitude(const double ps); 51 | 52 | bool refIsMsl; 53 | int fl; // Flight level 54 | int altFt; // Alt in feet 55 | double altMt; // Alt in meters 56 | bool isUnlimited; 57 | static const double K1, K2, QNE; 58 | static double QNH; 59 | }; 60 | -------------------------------------------------------------------------------- /src/KML.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | class Altitude; 21 | class Airspace; 22 | class Waypoint; 23 | class Airfield; 24 | 25 | class KML { 26 | public: 27 | KML(std::multimap& airspacesMap, std::multimap& waypointsMap); 28 | bool Write(const std::string& filename); 29 | inline bool WereAllAGLaltitudesCovered() const { return allAGLaltitudesCovered; } 30 | inline void ProcessLineStrings(bool LineStringAsAirspaces = true) { processLineString = LineStringAsAirspaces; } 31 | bool ReadKMZ(const std::string& filename); 32 | bool ReadKML(const std::string& filename); 33 | 34 | private: 35 | static std::string PrepareTagText(const std::string& text); 36 | void WriteHeader(const bool airspacePresent, const bool waypointsPresent); 37 | void OpenPlacemark(const Airspace& airspace); 38 | void OpenPlacemark(const Waypoint* waypoint); 39 | void OpenPolygon(const bool extrude, const bool absolute); 40 | void ClosePolygon(); 41 | void WriteSideWalls(const Airspace& airspace); 42 | void WriteSideWalls(const Airspace& airspace, const std::vector& altitudesAmsl); 43 | void WriteBaseOrTop(const Airspace& airspace, const Altitude& alt, const bool extrudeToGround = false); 44 | void WriteBaseOrTop(const Airspace& airspace, const std::vector& altitudesAmsl, const bool extrudeToGround = false); 45 | 46 | bool ProcessFolder(const boost::property_tree::ptree& folder, const int upperCategory); 47 | bool ProcessPlacemark(const boost::property_tree::ptree& placemark); 48 | static bool ProcessPolygon(const boost::property_tree::ptree& polygon, Airspace& airspace, bool& isExtruded, Altitude& avgAltitude); 49 | static bool ProcessCoordinates(const boost::property_tree::ptree& coordinates, Airspace& airspace, double& avgAltitude); 50 | static const std::string DetectIconsPath(); 51 | 52 | static const std::string colors[]; 53 | static const std::string airfieldColors[]; 54 | static const std::string waypointIcons[]; 55 | static const std::string iconsPath; 56 | std::multimap& airspaces; 57 | std::multimap& waypoints; 58 | std::ofstream outputFile; 59 | bool allAGLaltitudesCovered; 60 | bool processLineString; 61 | int folderCategory; 62 | }; 63 | -------------------------------------------------------------------------------- /QtGUI/MainWindow.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | #include 16 | #include "AboutDialog.hpp" 17 | #include "LimitsDialog.hpp" 18 | #include 19 | 20 | class AirspaceConverter; 21 | 22 | namespace Ui { 23 | class MainWindow; 24 | } 25 | 26 | class MainWindow : public QMainWindow 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit MainWindow(QWidget* parent = nullptr); 32 | ~MainWindow(); 33 | 34 | private: 35 | virtual void closeEvent(QCloseEvent *event); 36 | void postMessage(const std::string& text); 37 | void postWarning(const std::string& text); 38 | void postError(const std::string& text); 39 | void appendAndScrollLog(const QString& text); 40 | void startBusy(); 41 | void laodAirspacesThread(); 42 | void refreshUI(); 43 | 44 | Ui::MainWindow *ui; 45 | AboutDialog about; 46 | LimitsDialog filter; 47 | AirspaceConverter* converter; 48 | std::chrono::high_resolution_clock::time_point startTime; 49 | bool busy; 50 | QFutureWatcher watcher; 51 | QString suggestedInputDir; 52 | bool outputFileInsertedViaDialog; 53 | 54 | private slots: 55 | void on_aboutButton_clicked(); 56 | void on_outputFormatComboBox_currentIndexChanged(int index); 57 | void on_loadAirspaceFileButton_clicked(); 58 | void on_loadAirspaceFolderButton_clicked(); 59 | void on_unloadAirspacesButton_clicked(); 60 | void on_loadWaypointFileButton_clicked(); 61 | void on_loadWaypointsFolderButton_clicked(); 62 | void on_unloadWaypointsButton_clicked(); 63 | void on_loadRasterMapFileButton_clicked(); 64 | void on_loadRasterMapFolderButton_clicked(); 65 | void on_unloadTerrainMapsButton_clicked(); 66 | void on_filterButton_clicked(); 67 | void on_openOutputFileButton_clicked(); 68 | void on_openOutputFolderButton_clicked(); 69 | void on_convertButton_clicked(); 70 | void endBusy(); 71 | void logMessage(const QString& text); 72 | void logWarning(const QString& text); 73 | void logError(const QString& text); 74 | void applyFilter(bool area, const double& topLat, const double& bottomLat, const double& leftLon, const double& rightLon, bool altitude, const Altitude& floor, const Altitude& ceil); 75 | 76 | signals: 77 | void messagePosted(const QString& text); 78 | void warningPosted(const QString& text); 79 | void errorPosted(const QString& text); 80 | 81 | }; 82 | -------------------------------------------------------------------------------- /src/Waypoint.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | #include "Geometry.hpp" 16 | 17 | class Waypoint { 18 | 19 | public: 20 | enum WaypointType { 21 | unknown = 0, 22 | normal = 1, 23 | airfieldGrass, 24 | outlanding, 25 | gliderSite, 26 | airfieldSolid, 27 | mtPass, 28 | mtTop, 29 | sender, 30 | VOR, 31 | NDB, 32 | coolTower, 33 | dam, 34 | tunnel, 35 | bridge, 36 | powerPlant, 37 | castle, 38 | intersection, 39 | numOfWaypointTypes 40 | }; 41 | 42 | Waypoint(const std::string& longName, const std::string& shortName, const std::string& countryCode, const double lat, const double lon, const float alt, const int style, const std::string& descr); 43 | 44 | virtual ~Waypoint() {} 45 | 46 | inline static bool IsTypeAirfield(const Waypoint::WaypointType& kind) { return kind >= airfieldGrass && kind <= airfieldSolid; } 47 | inline static bool IsTypeAirfield(const int& kind) { return kind >= airfieldGrass && kind <= airfieldSolid; } 48 | 49 | inline const std::string& GetName() const { return name; } 50 | inline const std::string& GetCode() const { return code; } 51 | inline const std::string& GetCountry() const { return country; } 52 | inline const Geometry::LatLon& GetPosition() const { return pos; } 53 | inline double GetLatitude() const { return pos.Lat(); } 54 | inline double GetLongitude() const { return pos.Lon(); } 55 | inline float GetAltitude() const { return altitude; } 56 | inline WaypointType GetType() const { return type; } 57 | inline const std::string& GetTypeName() const { return TypeName(type); } 58 | inline const std::string& GetDescription() const { return description; } 59 | inline bool IsAirfield() const { return IsTypeAirfield(type); } 60 | inline void SetOtherFrequency(const int freq) { otherFreq = freq; } 61 | inline bool HasOtherFrequency() const { return otherFreq > 0; } 62 | inline int GetOtherFrequency() const { return otherFreq; } 63 | 64 | inline static const std::string& TypeName(const WaypointType& type) { return TYPE_NAMES[type]; } 65 | inline static const std::string& TypeName(const int& type) { return TYPE_NAMES[type]; } 66 | 67 | private: 68 | Geometry::LatLon pos; 69 | std::string name; 70 | std::string code; 71 | std::string country; 72 | float altitude; // [m] 73 | WaypointType type; 74 | int otherFreq; // [Hz] frequency for VOR NDB or secondary radio frequency for airports 75 | std::string description; 76 | static const std::string TYPE_NAMES[]; 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /Windows/AirspaceConverter.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29806.167 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AirspaceConverterMFC", "AirspaceConverterMFC\AirspaceConverterMFC.vcxproj", "{39B99CB8-DFCA-45A2-8AB8-FAC2EA6EE35E}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {1412BB18-5649-411D-B0A2-0A32E6402939} = {1412BB18-5649-411D-B0A2-0A32E6402939} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AirspaceConverterLib", "AirspaceConverterLib\AirspaceConverterLib.vcxproj", "{1412BB18-5649-411D-B0A2-0A32E6402939}" 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AirspaceConverter", "AirspaceConverter\AirspaceConverter.vcxproj", "{AF75346B-F52C-41C5-B762-8A84487874F9}" 14 | EndProject 15 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "AirspaceConverterSetup", "AirspaceConverterSetup64\AirspaceConverterSetup64.vdproj", "{4861A012-9358-4EED-B132-5C005B18B53D}" 16 | ProjectSection(ProjectDependencies) = postProject 17 | {1412BB18-5649-411D-B0A2-0A32E6402939} = {1412BB18-5649-411D-B0A2-0A32E6402939} 18 | {AF75346B-F52C-41C5-B762-8A84487874F9} = {AF75346B-F52C-41C5-B762-8A84487874F9} 19 | {39B99CB8-DFCA-45A2-8AB8-FAC2EA6EE35E} = {39B99CB8-DFCA-45A2-8AB8-FAC2EA6EE35E} 20 | EndProjectSection 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 24 | Debug|x64 = Debug|x64 25 | Release|x64 = Release|x64 26 | EndGlobalSection 27 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 28 | {39B99CB8-DFCA-45A2-8AB8-FAC2EA6EE35E}.Debug|x64.ActiveCfg = Debug|x64 29 | {39B99CB8-DFCA-45A2-8AB8-FAC2EA6EE35E}.Debug|x64.Build.0 = Debug|x64 30 | {39B99CB8-DFCA-45A2-8AB8-FAC2EA6EE35E}.Release|x64.ActiveCfg = Release|x64 31 | {39B99CB8-DFCA-45A2-8AB8-FAC2EA6EE35E}.Release|x64.Build.0 = Release|x64 32 | {1412BB18-5649-411D-B0A2-0A32E6402939}.Debug|x64.ActiveCfg = Debug|x64 33 | {1412BB18-5649-411D-B0A2-0A32E6402939}.Debug|x64.Build.0 = Debug|x64 34 | {1412BB18-5649-411D-B0A2-0A32E6402939}.Release|x64.ActiveCfg = Release|x64 35 | {1412BB18-5649-411D-B0A2-0A32E6402939}.Release|x64.Build.0 = Release|x64 36 | {AF75346B-F52C-41C5-B762-8A84487874F9}.Debug|x64.ActiveCfg = Debug|x64 37 | {AF75346B-F52C-41C5-B762-8A84487874F9}.Debug|x64.Build.0 = Debug|x64 38 | {AF75346B-F52C-41C5-B762-8A84487874F9}.Release|x64.ActiveCfg = Release|x64 39 | {AF75346B-F52C-41C5-B762-8A84487874F9}.Release|x64.Build.0 = Release|x64 40 | {4861A012-9358-4EED-B132-5C005B18B53D}.Debug|x64.ActiveCfg = Release 41 | {4861A012-9358-4EED-B132-5C005B18B53D}.Release|x64.ActiveCfg = Release 42 | EndGlobalSection 43 | GlobalSection(SolutionProperties) = preSolution 44 | HideSolutionNode = FALSE 45 | EndGlobalSection 46 | GlobalSection(ExtensibilityGlobals) = postSolution 47 | SolutionGuid = {BFE826CF-3CBB-48C5-8DA9-85B4106A3134} 48 | EndGlobalSection 49 | EndGlobal 50 | -------------------------------------------------------------------------------- /src/Altitude.cpp: -------------------------------------------------------------------------------- 1 | #include "Altitude.hpp" 2 | #include 3 | 4 | const double Altitude::FEET2METER = 0.3048; // 1 Ft = 0.3048 m 5 | const double Altitude::K1 = 0.190263; 6 | const double Altitude::K2 = 8.417286e-5; 7 | const double Altitude::QNE = 1013.25; 8 | double Altitude::QNH = QNE; 9 | 10 | Altitude::Altitude(): refIsMsl(false), fl(0), altFt(0), altMt(0), isUnlimited(false) {} 11 | 12 | Altitude::Altitude(const double value, bool isInMeters /* = false */, bool isMSL /* = true */): 13 | refIsMsl(isMSL), 14 | fl(0), 15 | altFt(int(isInMeters ? value / FEET2METER : value)), 16 | altMt(isInMeters ? value : value * FEET2METER), 17 | isUnlimited(false) { 18 | } 19 | 20 | Altitude::Altitude(const int FL) : 21 | refIsMsl(true), 22 | fl(FL), 23 | altFt(FL * 100), 24 | altMt(altFt * FEET2METER), 25 | isUnlimited(false) { 26 | if (QNH != QNE) { 27 | altMt = QNEaltitudeToQNHaltitude(altMt); 28 | altFt = (int)(altMt / FEET2METER); 29 | } 30 | } 31 | 32 | double Altitude::QNEaltitudeToStaticPressure(const double alt) { 33 | return std::pow((std::pow(QNE, K1) - K2*alt), 1.0 / K1); 34 | } 35 | 36 | double Altitude::StaticPressureToQNHaltitude(const double ps) { 37 | return (std::pow(QNH, K1) - std::pow(ps, K1)) / K2; 38 | } 39 | 40 | double Altitude::QNEaltitudeToQNHaltitude(const double ps) { 41 | return StaticPressureToQNHaltitude(QNEaltitudeToStaticPressure(ps)); 42 | } 43 | 44 | void Altitude::SetFlightLevel(const int FL) { 45 | fl = FL; 46 | refIsMsl = true; 47 | altFt = FL * 100; 48 | altMt = altFt * FEET2METER; 49 | if (QNH != QNE) { 50 | altMt = QNEaltitudeToQNHaltitude(altMt); 51 | altFt = (int)(altMt / FEET2METER); 52 | } 53 | } 54 | 55 | const std::string Altitude::ToString() const { 56 | if (isUnlimited) return "UNLIMITED"; 57 | if (fl > 0) return "FL" + std::to_string(fl); 58 | if (refIsMsl) { 59 | if(altFt!=0) return std::to_string(altFt) + " FT AMSL"; 60 | else return "MSL"; 61 | } 62 | if (IsGND()) return "GND"; 63 | return std::to_string(altFt) + " FT AGL"; 64 | } 65 | 66 | bool Altitude::operator<(const Altitude& other) const { 67 | if (isUnlimited && !other.isUnlimited) return false; 68 | if (!isUnlimited && other.isUnlimited) return true; 69 | return altMt < other.altMt; 70 | } 71 | 72 | bool Altitude::operator>(const Altitude& other) const { 73 | if (isUnlimited && !other.isUnlimited) return true; 74 | if (!isUnlimited && other.isUnlimited) return false; 75 | return altMt > other.altMt; 76 | } 77 | 78 | bool Altitude::operator<=(const Altitude& other) const { 79 | if (isUnlimited && !other.isUnlimited) return false; 80 | if (!isUnlimited && other.isUnlimited) return true; 81 | return altMt <= other.altMt; 82 | } 83 | 84 | bool Altitude::operator>=(const Altitude& other) const { 85 | if (isUnlimited && !other.isUnlimited) return true; 86 | if (!isUnlimited && other.isUnlimited) return false; 87 | return altMt >= other.altMt; 88 | } 89 | 90 | bool Altitude::operator==(const Altitude& other) const { 91 | if (isUnlimited == other.isUnlimited) return true; 92 | return altFt == other.altFt && refIsMsl == other.refIsMsl && fl == other.fl; 93 | } 94 | 95 | bool Altitude::operator!=(const Altitude& other) const { 96 | if (isUnlimited && other.isUnlimited) return false; 97 | return altFt != other.altFt || refIsMsl != other.refIsMsl || fl != other.fl; 98 | } 99 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at admin@alus.it. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /QtGUI/LimitsDialog.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 26/11/2017 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2017 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #include "LimitsDialog.hpp" 14 | #include "ui_LimitsDialog.h" 15 | #include 16 | #include "Geometry.hpp" 17 | #include "Altitude.hpp" 18 | 19 | LimitsDialog::LimitsDialog(QWidget *parent) : 20 | QDialog(parent), 21 | ui(new Ui::LimitsDialog), 22 | validLimits(false) { 23 | ui->setupUi(this); 24 | } 25 | 26 | LimitsDialog::~LimitsDialog() { 27 | delete ui; 28 | } 29 | 30 | void LimitsDialog::on_buttonBox_accepted() { 31 | bool validAreaLimits(false); 32 | if (ui->filterOnPositionCheckBox->isChecked()) { 33 | validAreaLimits = Geometry::Limits(ui->topLatSpinBox->value(), ui->bottomLatSpinBox->value(), ui->leftLonSpinBox->value(), ui->rightLonSpinBox->value()).IsValid(); 34 | if (!validAreaLimits) QMessageBox::warning(this, "Invalid area limits", tr("The entered area limit bounds are not valid."), QMessageBox::Ok); 35 | } 36 | bool validAltLimits(false); 37 | Altitude ceiling; 38 | Altitude floor; 39 | if (ui->filterOnAltitudeCheckBox->isChecked()) { 40 | if (ui->unlimitedTopAltitudeCheckBox->isChecked()) ceiling.SetUnlimited(); 41 | else ceiling = Altitude(double(ui->hiAltLimitSpinBox->value()), ui->hiAltLimitUnitComboBox->currentIndex() == 1, true); 42 | floor = Altitude(double(ui->lowAltLimitSpinBox->value()), ui->lowAltLimitUnitComboBox->currentIndex() == 1, true); 43 | validAltLimits = (ceiling >= floor); 44 | if (!validAltLimits) QMessageBox::warning(this, "Invalid altitude limits", tr("The entered altitude limits are not valid."), QMessageBox::Ok); 45 | } 46 | if (validAreaLimits || validAltLimits) 47 | emit validLimitsSet(validAreaLimits, ui->topLatSpinBox->value(), ui->bottomLatSpinBox->value(), ui->leftLonSpinBox->value(), ui->rightLonSpinBox->value(), validAltLimits, floor, ceiling); 48 | } 49 | 50 | void LimitsDialog::on_filterOnPositionCheckBox_stateChanged(int checked) { 51 | ui->topLatSpinBox->setEnabled(checked); 52 | ui->bottomLatSpinBox->setEnabled(checked); 53 | ui->leftLonSpinBox->setEnabled(checked); 54 | ui->rightLonSpinBox->setEnabled(checked); 55 | } 56 | 57 | void LimitsDialog::on_filterOnAltitudeCheckBox_stateChanged(int checked) { 58 | ui->hiAltLimitSpinBox->setEnabled(checked ? !ui->unlimitedTopAltitudeCheckBox->isChecked() : checked); 59 | ui->hiAltLimitUnitComboBox->setEnabled(checked ? !ui->unlimitedTopAltitudeCheckBox->isChecked() : checked); 60 | ui->lowAltLimitSpinBox->setEnabled(checked); 61 | ui->lowAltLimitUnitComboBox->setEnabled(checked); 62 | ui->unlimitedTopAltitudeCheckBox->setEnabled(checked); 63 | } 64 | 65 | void LimitsDialog::on_unlimitedTopAltitudeCheckBox_stateChanged(int checked) { 66 | ui->hiAltLimitSpinBox->setEnabled(!checked); 67 | ui->hiAltLimitUnitComboBox->setEnabled(!checked); 68 | } 69 | -------------------------------------------------------------------------------- /src/OpenAir.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "Airspace.hpp" 19 | #include "Geometry.hpp" 20 | 21 | class OpenAir { 22 | friend class Point; 23 | friend class Circle; 24 | friend class Sector; 25 | 26 | public: 27 | enum CoordinateType { 28 | DEG_DECIMAL_MIN = 0, 29 | DEG_MIN_SEC, 30 | AUTO 31 | }; 32 | 33 | OpenAir(std::multimap& airspacesMap); 34 | ~OpenAir() {} 35 | bool Read(const std::string& fileName); 36 | bool Write(const std::string& fileName); 37 | inline static void CalculateArcsAndCirconferences(const bool calcArcs = true) { calculateArcs = calcArcs; } 38 | inline static void SetCoordinateType(CoordinateType type) { coordinateType = type; } 39 | 40 | private: 41 | static std::string& RemoveComments(std::string &s); 42 | static bool ParseDegrees(const std::string& dddmmss, double& deg, bool isLon = false); 43 | static bool ParseCoordinates(const std::string& text, Geometry::LatLon& point); 44 | static bool ParseAN(const std::string& line, Airspace& airspace, const bool isUTF8 = false); 45 | static bool ParseAF(const std::string& line, Airspace& airspace, const bool isUTF8 = false); 46 | static bool ParseAltitude(const std::string& line, const bool isTop, Airspace& airspace); 47 | static bool ParseS (const std::string& line); 48 | static bool ParseT (const std::string& line); 49 | static bool ParseDP(const std::string& line, Airspace& airspace, const int& linenumber); 50 | static bool IsFileUTF8 (std::ifstream& inputFile); 51 | static bool CheckAngleDeg(const double& angleDeg); 52 | bool ParseAC(const std::string& line, Airspace& airspace); 53 | bool ParseV(const std::string& line, Airspace& airspace); 54 | bool ParseDA(const std::string& line, Airspace& airspace, const int& linenumber); 55 | bool ParseDB(const std::string& line, Airspace& airspace); 56 | bool ParseDC(const std::string& line, Airspace& airspace); 57 | bool InsertAirspace(Airspace& airspace); 58 | void WriteHeader(); 59 | bool WriteCategory(const Airspace& airsapce); 60 | void WritePoint(const Geometry::LatLon& point, bool isCenterPoint = false, bool addPrefix = true); 61 | void WriteLatLonDDMMSS(const int& latD, const int& latM, const int& latS, const char& NorS, const int& lonD, const int& lonM, const int& lonS, const char& EorW); 62 | void WriteLatLonDDMMmmm(const int& latD, const double& latM, const char& NorS, const int& lonD, const double& lonM, const char& EorW); 63 | void WritePoint(const Point& point); 64 | void WriteCircle(const Circle& circle); 65 | void WriteSector(const Sector& sector); 66 | 67 | static const std::unordered_map openAirAirspaceTable; 68 | static bool calculateArcs; 69 | static bool lastPointWasEqualToFirst; 70 | static CoordinateType coordinateType; 71 | static int linecount; 72 | std::multimap& airspaces; 73 | bool varRotationClockwise; 74 | Geometry::LatLon varPoint; 75 | std::ofstream file; 76 | int lastACline; 77 | bool lastPointWasDDMMSS; 78 | int lastLatD, lastLatM, lastLatS, lastLonD, lastLonM, lastLonS; 79 | }; 80 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/AirspaceConverterDlg.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include "afxcmn.h" 15 | #include "afxwin.h" 16 | #include 17 | #include 18 | 19 | class AirspaceConverter; 20 | class Processor; 21 | 22 | class CAirspaceConverterDlg : public CDialog { 23 | public: 24 | CAirspaceConverterDlg(CWnd* pParent = nullptr); 25 | ~CAirspaceConverterDlg(); 26 | 27 | // Dialog Data 28 | #ifdef AFX_DESIGN_TIME 29 | enum { IDD = IDD_AIRSPACECONVERTER_DIALOG }; 30 | #endif 31 | 32 | private: 33 | virtual void DoDataExchange(CDataExchange* pDX); 34 | HICON m_hIcon; 35 | 36 | // Generated message map functions 37 | virtual BOOL OnInitDialog(); 38 | DECLARE_MESSAGE_MAP() 39 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 40 | afx_msg void OnPaint(); 41 | afx_msg HCURSOR OnQueryDragIcon(); 42 | afx_msg void OnBnClickedAbout(); 43 | afx_msg void OnBnClickedInputFile(); 44 | afx_msg void OnBnClickedInputWaypoints(); 45 | afx_msg void OnBnClickedLoadDEM(); 46 | afx_msg void OnBnClickedInputFolderBt(); 47 | afx_msg void OnBnClickedInputWaypointsFolderBt(); 48 | afx_msg void OnBnClickedLoadDemFolderBt(); 49 | afx_msg void OnBnClickedClearInputBt(); 50 | afx_msg void OnBnClickedClearWaypointsBt(); 51 | afx_msg void OnBnClickedClearMapsBt(); 52 | afx_msg void OnBnClickedFilterBt(); 53 | afx_msg void OnBnClickedClearLogBt(); 54 | afx_msg void OnBnClickedConvert(); 55 | afx_msg void OnBnClickedOpenOutputFile(); 56 | afx_msg void OnBnClickedOpenOutputFolder(); 57 | afx_msg void OnBnClickedOutputTypeCombo(); 58 | LRESULT OnEndJob(WPARAM, LPARAM); 59 | 60 | void LogMessage(const std::string& text); 61 | void LogWarning(const std::string& text); 62 | void LogError(const std::string& text); 63 | void AppendAndScrollDownLog(const CString& text, CHARFORMAT& charFormat); 64 | void UpdateOutputFilename(); 65 | void EndBusy(const bool takeTime = false); 66 | void StartBusy(); 67 | bool BrowseForFolderDialog(std::string& path) const; 68 | 69 | CComboBox OutputTypeCombo; 70 | CButton loadInputFileBt; 71 | CButton loadDEMfileBt; 72 | CButton ConvertBt; 73 | CButton OpenOutputFileBt; 74 | CButton OpenOutputFolderBt; 75 | CButton LoadAirspacesFolderBt; 76 | CButton LoadRasterMapsFolderBt; 77 | CButton loadWaypointsBt; 78 | CButton loadWaypointsFolderBt; 79 | CButton unloadAirspacesBt; 80 | CButton unloadRasterMapsBt; 81 | CButton unloadWaypointsBt; 82 | CButton filterBt; 83 | CButton ClearLogBt; 84 | CButton CloseButton; 85 | CEdit editQNHtextField; 86 | CEdit editDefualtAltTextField; 87 | CButton pointsCheckBox; 88 | CComboBox OpenAirCoordinateFormatCombo; 89 | CRichEditCtrl LoggingBox; 90 | CProgressCtrl progressBar; 91 | 92 | double QNH; 93 | double defaultTerrainAlt; 94 | std::string outputFile; 95 | bool busy; 96 | AirspaceConverter* converter; 97 | Processor* processor; 98 | unsigned long numAirspacesLoaded; 99 | unsigned long numWaypointsLoaded; 100 | int numRasterMapLoaded; 101 | bool conversionDone; 102 | std::chrono::high_resolution_clock::time_point startTime; 103 | }; 104 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterLib/AirspaceConverterLib.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Header Files 16 | 17 | 18 | Header Files 19 | 20 | 21 | Header Files 22 | 23 | 24 | Header Files 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | 55 | 56 | Source Files 57 | 58 | 59 | Source Files 60 | 61 | 62 | Source Files 63 | 64 | 65 | Source Files 66 | 67 | 68 | Source Files 69 | 70 | 71 | Source Files 72 | 73 | 74 | Source Files 75 | 76 | 77 | Source Files 78 | 79 | 80 | Source Files 81 | 82 | 83 | Source Files 84 | 85 | 86 | Source Files 87 | 88 | 89 | Source Files 90 | 91 | 92 | Source Files 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #============================================================================ 2 | # AirspaceConverter 3 | # Since : 14/6/2016 4 | # Authors : Alberto Realis-Luc 5 | # Valerio Messina 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2016 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This source file is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Compiler options 14 | CPPFLAGS = -std=c++23 -Wall -Werror -fmessage-length=0 15 | 16 | # Product name 17 | APPNAME = airspaceconverter 18 | 19 | # Platform 20 | PLATFORM=$(shell uname -s) 21 | 22 | # Linker and strip options 23 | LFLAGS = -lzip '-Wl,-rpath,$$ORIGIN' 24 | STRIP = -S 25 | 26 | ifeq ($(PLATFORM),Linux) 27 | LIB = /usr/lib/x86_64-linux-gnu 28 | LIBFILE = lib$(APPNAME).so 29 | LFLAGS += -lboost_locale 30 | DYNLIBFLAGS = $(LFLAGS) -Wl,-soname,$(LIBFILE) 31 | STRIP += --strip-unneeded 32 | DEST = /usr/ 33 | else ifeq ($(PLATFORM),Darwin) 34 | LIB = /usr/local/lib 35 | LIBFILE = lib$(APPNAME).dylib 36 | LFLAGS += -lboost_locale-mt 37 | DEST = /usr/local/ 38 | DYNLIBFLAGS = $(LFLAGS) -Wl,-install_name,$(DEST)lib/$(LIBFILE) 39 | else 40 | #ERROR: Unknown platform! 41 | endif 42 | 43 | # Source path 44 | SRC = src/ 45 | 46 | # Release or debug, binary dir and specific compile options 47 | DEBUG ?= 0 48 | ifeq ($(DEBUG),1) 49 | CPPFLAGS += -O0 -g3 -DDEBUG 50 | BIN = Debug/ 51 | else 52 | CPPFLAGS += -O3 -DNDEBUG 53 | BIN = Release/ 54 | endif 55 | $(shell mkdir -p $(BIN) >/dev/null) 56 | 57 | # Dependencies dir 58 | DEPDIR = $(BIN).d/ 59 | $(shell mkdir -p $(DEPDIR) >/dev/null) 60 | 61 | # Dependencies flags 62 | DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)$*.Td 63 | 64 | # List of C++ source files 65 | CPPFILES = \ 66 | Airfield.cpp \ 67 | Altitude.cpp \ 68 | Airspace.cpp \ 69 | AirspaceConverter.cpp \ 70 | SeeYou.cpp \ 71 | Geometry.cpp \ 72 | KML.cpp \ 73 | OpenAIP.cpp \ 74 | OpenAir.cpp \ 75 | Polish.cpp \ 76 | RasterMap.cpp \ 77 | Waypoint.cpp \ 78 | CSV.cpp 79 | 80 | # List of object files 81 | OBJS = $(patsubst %.cpp, $(BIN)%.o, $(CPPFILES)) 82 | 83 | # Build all 84 | all: $(BIN)$(APPNAME) 85 | 86 | # Build the command line program 87 | $(BIN)$(APPNAME): $(BIN)$(LIBFILE) $(SRC)main.cpp 88 | @echo Building executable: $@ 89 | @g++ $(CPPFLAGS) -L$(BIN) $(SRC)main.cpp -l$(APPNAME) $(LFLAGS) -o $@ 90 | ifeq ($(DEBUG),0) 91 | @strip $(STRIP) $@ 92 | endif 93 | 94 | # Build the shared library 95 | $(BIN)$(LIBFILE): $(OBJS) 96 | @echo Building shared library: $@ 97 | @g++ -L$(LIB) $(DYNLIBFLAGS) -shared $(OBJS) -o $@ 98 | ifeq ($(DEBUG),0) 99 | @strip $(STRIP) $@ 100 | endif 101 | @chmod a-x $@ 102 | 103 | # Compile the sources of common shared library 104 | $(BIN)%.o: $(SRC)%.cpp 105 | $(BIN)%.o: $(SRC)%.cpp $(DEPDIR)%.d 106 | @echo 'Compiling: $<' 107 | @g++ $(DEPFLAGS) $(CPPFLAGS) -fPIC -c $< -o $@ 108 | @mv -f $(DEPDIR)$*.Td $(DEPDIR)$*.d 109 | 110 | # Compile dependencies 111 | $(DEPDIR)%.d: ; 112 | .PRECIOUS: $(DEPDIR)%.d 113 | 114 | -include $(patsubst %,$(DEPDIR)%.d,$(basename $(CPPFILES))) 115 | 116 | # Clean 117 | .PHONY: clean 118 | clean: 119 | @echo Cleaning all 120 | @rm -rf $(BIN) 121 | 122 | # Install 123 | .PHONY: install 124 | install: $(BIN)airspaceconverter 125 | @echo Installing AirspaceConverter CLI ... 126 | @cp $< $(DEST)bin 127 | @cp $(BIN)$(LIBFILE) $(DEST)lib 128 | @mkdir -p $(DEST)share/airspaceconverter/icons 129 | @cp icons/* $(DEST)share/airspaceconverter/icons 130 | @gzip -9 < airspaceconverter.1 > airspaceconverter.1.gz 131 | @mv airspaceconverter.1.gz $(DEST)share/man/man1/ 132 | @echo Done. 133 | 134 | # Uninstall 135 | .PHONY: uninstall 136 | uninstall: 137 | @echo Uninstalling AirspaceConverter CLI ... 138 | @rm -f $(DEST)bin/airspaceconverter 139 | @rm -f $(DEST)lib/$(LIBFILE) 140 | @rm -rf $(DEST)share/airspaceconverter 141 | @rm -rf $(DEST)share/man/man1/airspaceconverter.1.gz 142 | @echo Done. 143 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterMFC/Processor.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #include "stdafx.h" 14 | #include "Processor.hpp" 15 | #include "AirspaceConverter.hpp" 16 | #include 17 | #include 18 | 19 | Processor::Processor(HWND hwnd, AirspaceConverter* airspaceConverter) : 20 | window(hwnd) , 21 | converter(airspaceConverter) { 22 | assert(converter != nullptr); 23 | 24 | // Set the cGPSmapper invoker function (SO specific way to invoke cGPSmapper) 25 | AirspaceConverter::Set_cGPSmapperFunction(std::function(std::bind(&Processor::cGPSmapper, this, std::placeholders::_1, std::placeholders::_2))); 26 | } 27 | 28 | Processor::~Processor() {} 29 | 30 | bool Processor::cGPSmapper(const std::string& polishFile, const std::string& outputFile) const { 31 | // Here we call cGPSmapper in the Windows way.... anyaway it works also with system(".\\cGPSmapper\\cgpsmapper.exe "); on Windows as well 32 | AirspaceConverter::LogMessage("Invoking cGPSmapper to make: " + outputFile); 33 | 34 | //TODO: add arguments to create files also for other software like Garmin BaseCamp 35 | const std::string args(std::format("{} -o {}", polishFile, outputFile)); 36 | 37 | SHELLEXECUTEINFO lpShellExecInfo = { 0 }; 38 | lpShellExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); 39 | lpShellExecInfo.fMask = SEE_MASK_DOENVSUBST | SEE_MASK_NOCLOSEPROCESS; 40 | lpShellExecInfo.hwnd = NULL; 41 | lpShellExecInfo.lpVerb = NULL; 42 | lpShellExecInfo.lpFile = _com_util::ConvertStringToBSTR(converter->cGPSmapperCommand.c_str()); // _T(".\\cGPSmapper\\cgpsmapper.exe"); 43 | lpShellExecInfo.lpParameters = _com_util::ConvertStringToBSTR(args.c_str()); 44 | lpShellExecInfo.lpDirectory = NULL; 45 | lpShellExecInfo.nShow = SW_SHOW; 46 | lpShellExecInfo.hInstApp = (HINSTANCE)SE_ERR_DDEFAIL; 47 | ShellExecuteEx(&lpShellExecInfo); 48 | if (lpShellExecInfo.hProcess != NULL) { 49 | WaitForSingleObject(lpShellExecInfo.hProcess, INFINITE); 50 | CloseHandle(lpShellExecInfo.hProcess); 51 | std::remove(polishFile.c_str()); // Delete polish file 52 | return true; 53 | } 54 | AirspaceConverter::LogError("Failed to start cGPSmapper process."); 55 | return false; 56 | } 57 | 58 | bool Processor::LoadAirspacesFiles(const double& newQNH) { 59 | if (workerThread.joinable()) return false; 60 | converter->SetQNH(newQNH); 61 | workerThread = std::thread(std::bind(&Processor::LoadAirspacesFilesThread, this)); 62 | return true; 63 | } 64 | 65 | void Processor::LoadAirspacesFilesThread() { 66 | converter->LoadAirspaces(); 67 | PostMessage(window, WM_GENERAL_WORK_DONE, 0, 0); 68 | } 69 | 70 | bool Processor::LoadDEMfiles() { 71 | if (workerThread.joinable()) return false; 72 | workerThread = std::thread(std::bind(&Processor::LoadDEMfilesThread, this)); 73 | return true; 74 | } 75 | 76 | void Processor::LoadDEMfilesThread() { 77 | converter->LoadTerrainRasterMaps(); 78 | PostMessage(window, WM_GENERAL_WORK_DONE, 0, 0); 79 | } 80 | 81 | bool Processor::LoadWaypointsFiles() { 82 | if (workerThread.joinable()) return false; 83 | workerThread = std::thread(std::bind(&Processor::LoadWaypointsFilesThread, this)); 84 | return true; 85 | } 86 | 87 | void Processor::LoadWaypointsFilesThread() { 88 | converter->LoadWaypoints(); 89 | PostMessage(window, WM_GENERAL_WORK_DONE, 0, 0); 90 | } 91 | 92 | bool Processor::Convert() { 93 | if (workerThread.joinable()) return false; 94 | workerThread = std::thread(std::bind(&Processor::ConvertThread, this)); 95 | return true; 96 | } 97 | 98 | void Processor::ConvertThread() { 99 | converter->Convert(); 100 | PostMessage(window, WM_GENERAL_WORK_DONE, 0, 0); 101 | } 102 | -------------------------------------------------------------------------------- /QtGUI/AirspaceConverterQt.pro: -------------------------------------------------------------------------------- 1 | #============================================================================ 2 | # AirspaceConverter 3 | # Since : 14/6/2016 4 | # Author : Alberto Realis-Luc 5 | # Web : https://www.alus.it/AirspaceConverter 6 | # Repository : https://github.com/alus-it/AirspaceConverter.git 7 | # Copyright : (C) 2016 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This Qt project was created on: 2017-01-29T12:24:53 11 | # This source file is part of AirspaceConverter project 12 | #============================================================================ 13 | 14 | QT += core gui 15 | 16 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 17 | 18 | TARGET = airspaceconverter-gui 19 | TEMPLATE = app 20 | CONFIG += c++23 21 | QMAKE_CXXFLAGS += -std=c++23 22 | 23 | RESOURCES += \ 24 | resources.qrc 25 | 26 | SOURCES += main.cpp\ 27 | AboutDialog.cpp \ 28 | LimitsDialog.cpp \ 29 | MainWindow.cpp 30 | 31 | HEADERS += \ 32 | AboutDialog.hpp \ 33 | LimitsDialog.hpp \ 34 | MainWindow.hpp 35 | 36 | FORMS += \ 37 | AboutDialog.ui \ 38 | LimitsDialog.ui \ 39 | MainWindow.ui 40 | 41 | # Include headers of libAirspaceConverter 42 | INCLUDEPATH += $$PWD/../src/ 43 | DEPENDPATH += $$PWD/../src/ 44 | 45 | # libAirspaceConverter libary for Linux and Mac 46 | unix: LIBS += -L$$PWD/../Release/ -lairspaceconverter \'-Wl,-rpath=\$$ORIGIN\' 47 | 48 | 49 | ## Linux libraries 50 | 51 | # Boost libraries 52 | unix:!macx: LIBS += -L/usr/lib/x86_64-linux-gnu/ -lboost_locale 53 | 54 | # Zip library 55 | unix:!macx: LIBS += -L/usr/lib/x86_64-linux-gnu/ -lzip 56 | 57 | 58 | ## Mac libraries 59 | macx: INCLUDEPATH += /usr/local/include/ 60 | 61 | # Boost libraries 62 | macx: LIBS += -L/usr/local/lib/ -lboost_locale-mt 63 | 64 | # Zip library 65 | macx: LIBS += -L/usr/local/lib/ -lzip 66 | 67 | 68 | ## Windows libraries on 64 bit 69 | win32:contains(QMAKE_HOST.arch, x86_64) { 70 | 71 | # libAirspaceConverter 72 | win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../Windows/Release/x64/ -lAirspaceConverterLib 73 | else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../Windows/Debug/x64/ -lAirspaceConverterLib 74 | win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../Windows/Release/x64/AirspaceConverterLib.lib 75 | else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../Windows/Debug/x64/AirspaceConverterLib.lib 76 | 77 | # Boost 1.61.0 (to be updated...) 78 | win32:CONFIG(release, debug|release): LIBS += -LC:/boost_1_61_0/lib64/ -llibboost_locale-vc140-mt-1_61 79 | else:win32:CONFIG(debug, debug|release): LIBS += -LC:/boost_1_61_0/lib64/ -llibboost_locale-vc140-mt-gd-1_61 80 | INCLUDEPATH += C:/boost_1_61_0 81 | DEPENDPATH += C:/boost_1_61_0 82 | 83 | # libzip 84 | win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../Windows/packages/libzip.1.1.2.7/build/native/lib/x64/v140/Release/ -lzip 85 | else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../Windows/packages/libzip.1.1.2.7/build/native/lib/x64/v140/Debug/ -lzip 86 | INCLUDEPATH += $$PWD/../Windows/packages/libzip.1.1.2.7/build/native/include 87 | DEPENDPATH += $$PWD/../Windows/packages/libzip.1.1.2.7/build/native/include 88 | 89 | ## Windows libraries on 32 bit 90 | } else { 91 | 92 | # Windows link to libAirspaceConverter 93 | win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../Windows/Release/Win32/ -lAirspaceConverterLib 94 | else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../Windows/Debug/Win32/ -lAirspaceConverterLib 95 | win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../Windows/Release/Win32/AirspaceConverterLib.lib 96 | else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../Windows/Debug/Win32/AirspaceConverterLib.lib 97 | 98 | # Boost 1.61.0 (to be updated...) 99 | win32:CONFIG(release, debug|release): LIBS += -LC:/boost_1_61_0/lib32/ -llibboost_locale-vc140-mt-1_61 100 | else:win32:CONFIG(debug, debug|release): LIBS += -LC:/boost_1_61_0/lib32/ -llibboost_locale-vc140-mt-gd-1_61 101 | INCLUDEPATH += C:/boost_1_61_0 102 | DEPENDPATH += C:/boost_1_61_0 103 | 104 | # Windows link to libzip 105 | win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../Windows/packages/libzip.1.1.2.7/build/native/lib/Win32/v140/Release/ -lzip 106 | else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../Windows/packages/libzip.1.1.2.7/build/native/lib/Win32/v140/Debug/ -lzip 107 | INCLUDEPATH += $$PWD/../Windows/packages/libzip.1.1.2.7/build/native/include 108 | DEPENDPATH += $$PWD/../Windows/packages/libzip.1.1.2.7/build/native/include 109 | } 110 | -------------------------------------------------------------------------------- /macOS/Makefile.darwin-clang++: -------------------------------------------------------------------------------- 1 | #============================================================================ 2 | # AirspaceConverter 3 | # Since : 14/6/2016 4 | # Authors : Alberto Realis-Luc 5 | # Valerio Messina 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2016 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This source file is part of AirspaceConverter project 11 | #============================================================================ 12 | # Note: use this Makefile to cross-compile from Linux to macOS 13 | # Note: need to be exported the env vars: 14 | # $(OCROSS) cross-compiler tools prefix, eg. x86_64-apple-darwin18- 15 | # $(OSXROOT) point to cross-compiler root path, eg. /opt/osxcross 16 | # $(OSXDEPS) point to $(OSXROOT)/target/macports 17 | # Note: $(OSXROOT)/target/bin must be in PATH to find $(OCROSS) 18 | # 19 | CC=$(OCROSS)clang # CC=o64-clang 20 | CXX=$(OCROSS)clang++ # CXX=o64-clang++ 21 | LD=$(OCROSS)clang++ 22 | AR=$(OCROSS)ar 23 | PKG-CONFIG=$(OCROSS)pkg-config 24 | STRIP=$(OCROSS)strip 25 | CFLAGS = -I$(OSXDEPS)/pkgs/opt/local/include 26 | 27 | # Compiler options 28 | CPPFLAGS = -std=c++14 -stdlib=libc++ -Wall -fmessage-length=0 $(CFLAGS) 29 | 30 | # Product name 31 | APPNAME = airspaceconverter 32 | 33 | # Platform 34 | PLATFORM=$(shell uname -s) 35 | 36 | # Linker and strip options 37 | LFLAGS = -L$(OSXDEPS)/pkgs/opt/local/lib -lzip -lboost_system-mt -lboost_filesystem-mt '-Wl,-rpath,$$ORIGIN' 38 | STRIPFLAGS = -S 39 | 40 | ifeq ($(PLATFORM),Linux) 41 | LIB = $(OSXDEPS)/pkgs/opt/local/lib 42 | LIBFILE = lib$(APPNAME).dylib 43 | LFLAGS += -lboost_locale-mt 44 | DYNLIBFLAGS = $(LFLAGS) -Wl,-install_name,$(LIBFILE) 45 | DEST = /usr/ 46 | #STRIPFLAGS += --strip-unneeded 47 | else ifeq ($(PLATFORM),Darwin) 48 | LIB = /usr/local/lib 49 | LIBFILE = lib$(APPNAME).dylib 50 | LFLAGS += -lboost_locale-mt 51 | DYNLIBFLAGS = $(LFLAGS) -Wl,-install_name,$(DEST)lib/$(LIBFILE) 52 | DEST = /usr/local/ 53 | else 54 | #ERROR: Unknown platform! 55 | endif 56 | LDFLAGS = -L$(LIB) 57 | 58 | 59 | # Source path 60 | SRC = src/ 61 | 62 | # Release or debug, binary dir and specific compile options 63 | DEBUG ?= 0 64 | ifeq ($(DEBUG),1) 65 | CPPFLAGS += -O0 -g3 -DDEBUG 66 | BIN = Debug/ 67 | else 68 | CPPFLAGS += -O3 -DNDEBUG 69 | BIN = Release/ 70 | endif 71 | $(shell mkdir -p $(BIN) >/dev/null) 72 | 73 | # Dependencies dir 74 | DEPDIR = $(BIN).d/ 75 | $(shell mkdir -p $(DEPDIR) >/dev/null) 76 | 77 | # Dependencies flags 78 | DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)$*.Td 79 | 80 | # List of C++ source files 81 | CPPFILES = \ 82 | Airfield.cpp \ 83 | Airspace.cpp \ 84 | AirspaceConverter.cpp \ 85 | SeeYou.cpp \ 86 | Geometry.cpp \ 87 | KML.cpp \ 88 | OpenAIP.cpp \ 89 | OpenAir.cpp \ 90 | Polish.cpp \ 91 | RasterMap.cpp \ 92 | Waypoint.cpp \ 93 | CSV.cpp 94 | 95 | # List of object files 96 | OBJS = $(patsubst %.cpp, $(BIN)%.o, $(CPPFILES)) 97 | 98 | # Build all 99 | all: $(BIN)$(APPNAME) 100 | 101 | # Build the command line program 102 | $(BIN)$(APPNAME): $(BIN)$(LIBFILE) $(SRC)main.cpp 103 | @echo CrossBuilding executable: $@ 104 | @$(CXX) $(CPPFLAGS) -L$(BIN) $(SRC)main.cpp -l$(APPNAME) $(LFLAGS) -o $@ 105 | ifeq ($(DEBUG),0) 106 | @$(STRIP) $(STRIPFLAGS) $@ 107 | endif 108 | 109 | # Build the shared library 110 | $(BIN)$(LIBFILE): $(OBJS) 111 | @echo CrossBuilding shared library: $@ 112 | @$(CXX) $(LDFLAGS) $(DYNLIBFLAGS) -shared $(OBJS) -o $@ 113 | ifeq ($(DEBUG),0) 114 | @$(STRIP) $(STRIPFLAGS) $@ 115 | endif 116 | @chmod a-x $@ 117 | 118 | # Compile the sources of common shared library 119 | $(BIN)%.o: $(SRC)%.cpp 120 | $(BIN)%.o: $(SRC)%.cpp $(DEPDIR)%.d 121 | @echo 'CrossCompiling: $<' 122 | @$(CXX) $(DEPFLAGS) $(CPPFLAGS) -fPIC -c $< -o $@ 123 | @mv -f $(DEPDIR)$*.Td $(DEPDIR)$*.d 124 | 125 | # Compile dependencies 126 | $(DEPDIR)%.d: ; 127 | .PRECIOUS: $(DEPDIR)%.d 128 | 129 | -include $(patsubst %,$(DEPDIR)%.d,$(basename $(CPPFILES))) 130 | 131 | # Clean 132 | .PHONY: clean 133 | clean: 134 | @echo Cleaning all 135 | @rm -rf $(BIN) 136 | 137 | # Install 138 | .PHONY: install 139 | install: $(BIN)airspaceconverter 140 | @echo Installing AirspaceConverter CLI ... 141 | @cp $< $(DEST)bin 142 | @cp $(BIN)$(LIBFILE) $(DEST)lib 143 | @mkdir -p $(DEST)share/airspaceconverter/icons 144 | @cp icons/* $(DEST)share/airspaceconverter/icons 145 | @gzip -9 < airspaceconverter.1 > airspaceconverter.1.gz 146 | @mv airspaceconverter.1.gz $(DEST)share/man/man1/ 147 | @echo Done. 148 | 149 | # Uninstall 150 | .PHONY: uninstall 151 | uninstall: 152 | @echo Uninstalling AirspaceConverter CLI ... 153 | @rm -f $(DEST)bin/airspaceconverter 154 | @rm -f $(DEST)lib/$(LIBFILE) 155 | @rm -rf $(DEST)share/airspaceconverter 156 | @rm -rf $(DEST)share/man/man1/airspaceconverter.1.gz 157 | @echo Done. 158 | -------------------------------------------------------------------------------- /src/Polish.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #include "Polish.hpp" 14 | #include "AirspaceConverter.hpp" 15 | #include "Airspace.hpp" 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | /* TODO: customized types 22 | const int PFMwriter::types[] = { 23 | 0x60, //CLASSA 24 | 0x61, //CLASSB 25 | 0x69, //CLASSC 26 | 0x62, //CLASSD 27 | 0x66, //CLASSE 28 | 0x63, //CLASSF 29 | 0x69, //CLASSG 30 | 0x63, //DANGER 31 | 0x66, //PROHIBITED 32 | 0x61, //RESTRICTED 33 | 0x61, //CTR 34 | 0x64, //TMA 35 | 0x60, //TMZ 36 | 0x60, //RMZ 37 | 0x01, //FIR 38 | 0x01, //UIR 39 | 0x01, //OTH 40 | 0x69, //GLIDING 41 | 0x62, //NOGLIDER 42 | 0x69, //WAVE 43 | 0x01, //UNKNOWN 44 | 0x01 //UNDEFINED 45 | }; 46 | */ 47 | 48 | const std::string Polish::MakeLabel(const Airspace& airspace) { 49 | std::stringstream ss; 50 | ss << airspace.GetCategoryName() << " " 51 | << airspace.GetTopAltitude().ToString() << " - " 52 | << airspace.GetBaseAltitude().ToString() << " " 53 | << airspace.GetName(); 54 | std::string label(ss.str()); 55 | if(label.length()>80) label.resize(80); 56 | return label; 57 | } 58 | 59 | void Polish::WriteHeader(const std::string& filename) { 60 | for(const std::string& line: AirspaceConverter::disclaimer) file << ";" << line << "\n"; 61 | file << "\n;" << AirspaceConverter::GetFullCreationDateTimeString() << "\n\n" 62 | << "[IMG ID]\n" //section identifier 63 | << "ID=62831853\n" // unique identifier: 2 PI 64 | << "Name=" << std::filesystem::path(filename).stem().string() << "\n" // map name 65 | << "LBLcoding=6\n" 66 | << "Codepage=1252\n" 67 | << "Datum=W84\n" 68 | << "Transparent=Y\n" 69 | << "MG=N\n" 70 | << "Numbering=N\n" 71 | << "Routing=N\n" 72 | << "Lock=N\n" 73 | << "ProductCode=1\n" 74 | << "CopyRight=AirspaceConverter www.alus.it/AirspaceConverter\n" 75 | << "Elevation=m\n" 76 | << "POIIndex=N\n" 77 | << "TreSize=1311\n" 78 | << "RgnLimit=1024\n" 79 | << "PreProcess=F\n" 80 | << "Levels=5\n" 81 | << "Level0=24\n" 82 | << "Level1=21\n" 83 | << "Level2=18\n" 84 | << "Level3=15\n" 85 | << "Level4=12\n" 86 | << "Zoom0=0\n" 87 | << "Zoom1=1\n" 88 | << "Zoom2=2\n" 89 | << "Zoom3=3\n" 90 | << "Zoom4=4\n" 91 | << "[END]\n\n"; 92 | } 93 | 94 | bool Polish::Write(const std::string& filename, const std::multimap& airspaces) { 95 | if (airspaces.empty()) { 96 | AirspaceConverter::LogMessage("Polish output: no airspace, nothing to write"); 97 | return false; 98 | } 99 | 100 | // Check if has the right extension 101 | if (!boost::iequals(std::filesystem::path(filename).extension().string(), ".mp")) { 102 | AirspaceConverter::LogError("expected MP extension but found: " + std::filesystem::path(filename).extension().string()); 103 | return false; 104 | } 105 | 106 | if (file.is_open()) file.close(); 107 | file.open(filename, std::ios::out | std::ios::trunc | std::ios::binary); 108 | if (!file.is_open() || file.bad()) { 109 | AirspaceConverter::LogError("Unable to open output file: " + filename); 110 | return false; 111 | } 112 | AirspaceConverter::LogMessage("Writing Polish output file: " + filename); 113 | 114 | WriteHeader(filename); 115 | 116 | // Go trough all airspaces 117 | for (const std::pair& pair : airspaces) 118 | { 119 | // Get the airspace 120 | const Airspace& a = pair.second; 121 | 122 | // Just a couple if assertions 123 | assert(a.GetNumberOfPoints() > 3); 124 | assert(a.GetFirstPoint()==a.GetLastPoint()); 125 | 126 | // Determine if it's a POLYGON or a POLYLINE 127 | if (a.GetType() == Airspace::P || a.GetType() == Airspace::CTR || a.GetType() == Airspace::D) { 128 | file << "[POLYGON]\n" 129 | //<< "Type="<< types[a.GetType()] <<"\n"; //TODO... 130 | << "Type=0x18" <<"\n"; 131 | } else { 132 | file << "[POLYLINE]\n" 133 | << "Type=0x07\n"; //TODO.... 134 | } 135 | 136 | // Add the label 137 | file << "Label="< 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2017 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #include "stdafx.h" 14 | #include "LimitsDlg.hpp" 15 | #include "Resource.h" 16 | #include "Geometry.hpp" 17 | 18 | CLimitsDlg::CLimitsDlg(): 19 | CDialog(IDD_LIMITS_DIALOG), 20 | northLatLimit(90), 21 | southLatLimit(-90), 22 | eastLonLimit(180), 23 | westLonLimit(-180), 24 | validAreaLimitsSet(false), 25 | topAltitude(200000.0), 26 | lowAltitude(-10000.0), 27 | validAltitudeLimitsSet(false) { 28 | } 29 | 30 | BEGIN_MESSAGE_MAP(CLimitsDlg, CDialog) 31 | ON_BN_CLICKED(IDC_CHECK_UNLIMITED_ALT_LIMIT, &CLimitsDlg::OnBnClickedCheckUnlimitedAltLimit) 32 | ON_BN_CLICKED(IDC_CHECK_FILTER_ON_ALTITUDE, &CLimitsDlg::OnBnClickedCheckFilterOnAltitude) 33 | ON_BN_CLICKED(IDC_CHECK_FILTER_ON_AREA, &CLimitsDlg::OnBnClickedCheckFilterOnArea) 34 | END_MESSAGE_MAP() 35 | 36 | BOOL CLimitsDlg::OnInitDialog() { 37 | CDialog::OnInitDialog(); 38 | topAltitudeUnitCombo.InsertString(-1, _T("ft")); 39 | topAltitudeUnitCombo.InsertString(-1, _T("m")); 40 | topAltitudeUnitCombo.SetCurSel(0); 41 | lowAltitudeUnitCombo.InsertString(-1, _T("ft")); 42 | lowAltitudeUnitCombo.InsertString(-1, _T("m")); 43 | lowAltitudeUnitCombo.SetCurSel(0); 44 | return TRUE; 45 | } 46 | 47 | void CLimitsDlg::DoDataExchange(CDataExchange* pDX) { 48 | CDialog::DoDataExchange(pDX); 49 | DDX_Text(pDX, IDC_NORTH, northLatLimit); 50 | DDV_MinMaxDouble(pDX, northLatLimit, -90, 90); 51 | DDX_Text(pDX, IDC_SOUTH, southLatLimit); 52 | DDV_MinMaxDouble(pDX, southLatLimit, -90, 90); 53 | DDX_Text(pDX, IDC_EAST, eastLonLimit); 54 | DDV_MinMaxDouble(pDX, eastLonLimit, -180, 180); 55 | DDX_Text(pDX, IDC_WEST, westLonLimit); 56 | DDV_MinMaxDouble(pDX, westLonLimit, -180, 180); 57 | double topAltLimit = topAltitude.GetAltFt(); 58 | DDX_Text(pDX, IDC_TOP_ALT_LIMIT, topAltLimit); 59 | DDV_MinMaxDouble(pDX, topAltLimit, -10000, 200000); 60 | if (!topAltitude.IsUnlimited()) { 61 | int topAltUnitIndex = 0; // Index 0 default feet 62 | DDX_CBIndex(pDX, IDC_COMBO_TOP_ALT_UNIT, topAltUnitIndex); 63 | topAltitude = Altitude(topAltLimit, topAltUnitIndex == 1, true); 64 | } 65 | double lowAltLimit = lowAltitude.GetAltFt(); 66 | DDX_Text(pDX, IDC_LOW_ALT_LIMIT, lowAltLimit); 67 | DDV_MinMaxDouble(pDX, lowAltLimit, -10000, 200000); 68 | int lowAltUnitIndex = 0; // Index 0 default feet 69 | DDX_CBIndex(pDX, IDC_COMBO_LOW_ALT_UNIT, lowAltUnitIndex); 70 | lowAltitude = Altitude(lowAltLimit, lowAltUnitIndex == 1, true); 71 | DDX_Control(pDX, IDC_CHECK_FILTER_ON_AREA, filterOnAreaCheckbox); 72 | DDX_Control(pDX, IDC_CHECK_FILTER_ON_ALTITUDE, filterOnAltitudeCheckbox); 73 | DDX_Control(pDX, IDC_CHECK_UNLIMITED_ALT_LIMIT, unlimitedTopAltitudeCheckbox); 74 | DDX_Control(pDX, IDC_COMBO_TOP_ALT_UNIT, topAltitudeUnitCombo); 75 | DDX_Control(pDX, IDC_COMBO_LOW_ALT_UNIT, lowAltitudeUnitCombo); 76 | DDX_Control(pDX, IDC_NORTH, northLatLimitEdit); 77 | DDX_Control(pDX, IDC_SOUTH, southLatLimitEdit); 78 | DDX_Control(pDX, IDC_EAST, eastLonLimitEdit); 79 | DDX_Control(pDX, IDC_WEST, westLonLimitEdit); 80 | DDX_Control(pDX, IDC_TOP_ALT_LIMIT, topAltitudeEdit); 81 | DDX_Control(pDX, IDC_LOW_ALT_LIMIT, lowAltitudeEdit); 82 | } 83 | 84 | void CLimitsDlg::OnOK() { 85 | if (!UpdateData(TRUE)) return; 86 | bool validAreaLimits = true, validAltitudeLimits = true; 87 | if (filterOnAreaCheckbox.GetCheck() == BST_CHECKED) { 88 | validAreaLimits = Geometry::Limits(northLatLimit, southLatLimit, westLonLimit, eastLonLimit).IsValid(); 89 | validAreaLimitsSet = validAreaLimits; 90 | } else validAreaLimitsSet = false; 91 | if (filterOnAltitudeCheckbox.GetCheck() == BST_CHECKED) { 92 | validAltitudeLimits = (topAltitude >= lowAltitude); 93 | validAltitudeLimitsSet = validAltitudeLimits; 94 | } else validAltitudeLimitsSet = false; 95 | if (validAreaLimits && validAltitudeLimits) return CDialog::OnOK(); 96 | if (!validAreaLimits) MessageBox(_T("The inserted area limits are not valid!"), _T("Error"), MB_ICONERROR); 97 | if (!validAltitudeLimits) MessageBox(_T("The inserted altitude limits are not valid!"), _T("Error"), MB_ICONERROR); 98 | } 99 | 100 | void CLimitsDlg::OnBnClickedCheckUnlimitedAltLimit() { 101 | const bool topLimited(unlimitedTopAltitudeCheckbox.GetCheck() != BST_CHECKED); 102 | topAltitude.SetUnlimited(!topLimited); 103 | topAltitudeEdit.EnableWindow(topLimited); 104 | topAltitudeUnitCombo.EnableWindow(topLimited); 105 | } 106 | 107 | void CLimitsDlg::OnBnClickedCheckFilterOnAltitude() { 108 | const bool filterOnAltitude(filterOnAltitudeCheckbox.GetCheck() == BST_CHECKED); 109 | unlimitedTopAltitudeCheckbox.EnableWindow(filterOnAltitude); 110 | const bool topLimited = (unlimitedTopAltitudeCheckbox.GetCheck() != BST_CHECKED); 111 | topAltitudeEdit.EnableWindow(filterOnAltitude && topLimited); 112 | topAltitudeUnitCombo.EnableWindow(filterOnAltitude && topLimited); 113 | lowAltitudeEdit.EnableWindow(filterOnAltitude); 114 | lowAltitudeUnitCombo.EnableWindow(filterOnAltitude); 115 | } 116 | 117 | void CLimitsDlg::OnBnClickedCheckFilterOnArea() { 118 | const bool filterOnArea(filterOnAreaCheckbox.GetCheck() == BST_CHECKED); 119 | northLatLimitEdit.EnableWindow(filterOnArea); 120 | southLatLimitEdit.EnableWindow(filterOnArea); 121 | eastLonLimitEdit.EnableWindow(filterOnArea); 122 | westLonLimitEdit.EnableWindow(filterOnArea); 123 | } 124 | -------------------------------------------------------------------------------- /macOS/makeApp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #============================================================================ 3 | # AirspaceConverter 4 | # Since : 13/2/2020 5 | # Author : Alberto Realis-Luc 6 | # Web : https://www.alus.it/AirspaceConverter 7 | # Copyright : (C) 2020 Alberto Realis-Luc 8 | # License : GNU GPL v3 9 | # 10 | # This script is part of AirspaceConverter project 11 | #============================================================================ 12 | 13 | # Make sure that we are on macOS 14 | if [ "$(uname)" != "Darwin" ]; then 15 | echo "ERROR: this script is only for macOS ..." 16 | exit 1 17 | fi 18 | 19 | # First of all: build if necessary 20 | cd .. 21 | ./build.sh 22 | cd macOS 23 | 24 | # Clean older distribution files 25 | ./clean.sh 26 | 27 | # Start building application bundle 28 | echo "Building AirspaceConverter.app application bundle ..." 29 | mkdir AirspaceConverter.app 30 | cd AirspaceConverter.app 31 | mkdir Contents 32 | cd Contents 33 | 34 | # Copy Info.plist and Pkginfo 35 | cp ../../Info.plist ./ 36 | cp ../../PkgInfo ./ 37 | chmod a-w * 38 | 39 | # Prepare Resoulces folder 40 | mkdir Resources 41 | cd Resources 42 | 43 | # Copy application icon 44 | cp ../../../AirspaceConverter.icns ./ 45 | chmod a-w ./AirspaceConverter.icns 46 | 47 | # Copy KML icons 48 | cp -r ../../../../icons ./ 49 | chmod a-w ./icons/* 50 | 51 | cd .. 52 | 53 | # Prepare MacOS directory (for binaries) 54 | mkdir MacOS 55 | cd MacOS 56 | 57 | # Copy AirspaceConverter dynamic shared library 58 | cp ../../../../Release/libairspaceconverter.dylib ./ 59 | 60 | # Copy AirspaceConverter CLI 61 | cp ../../../../Release/airspaceconverter ./ 62 | 63 | # Copy AirspaceConverter Qt GUI exectutable 64 | cp ../../../../buildQt/airspaceconverter-gui.app/Contents/MacOS/airspaceconverter-gui ./ 65 | 66 | # To find out the required libraries: 67 | #$ otool -L airspaceconverter 68 | 69 | # Copy all the other the required libaries into the bundle 70 | cp /usr/local/opt/libzip/lib/libzip.5.dylib ./ 71 | cp /usr/local/opt/boost/lib/libboost_filesystem.dylib ./ 72 | cp /usr/local/opt/boost/lib/libboost_system.dylib ./ 73 | cp /usr/local/opt/boost/lib/libboost_system-mt.dylib ./ 74 | cp /usr/local/opt/boost/lib/libboost_locale-mt.dylib ./ 75 | cp /usr/local/opt/boost/lib/libboost_chrono-mt.dylib ./ 76 | cp /usr/local/opt/boost/lib/libboost_thread-mt.dylib ./ 77 | cp /usr/local/opt/icu4c/lib/libicudata.64.dylib ./ 78 | cp /usr/local/opt/icu4c/lib/libicui18n.64.dylib ./ 79 | cp /usr/local/opt/icu4c/lib/libicuuc.64.dylib ./ 80 | cp /Users/arealis/Qt/5.12.5/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets ./ 81 | cp /Users/arealis/Qt/5.12.5/clang_64/lib/QtGui.framework/Versions/5/QtGui ./ 82 | cp /Users/arealis/Qt/5.12.5/clang_64/lib/QtCore.framework/Versions/5/QtCore ./ 83 | 84 | # Tell the CLI executable to use the libraries in the same folder 85 | install_name_tool -change /usr/local/lib/libairspaceconverter.dylib @executable_path/libairspaceconverter.dylib ./airspaceconverter 86 | install_name_tool -change /usr/local/opt/libzip/lib/libzip.5.dylib @executable_path/libzip.5.dylib ./airspaceconverter 87 | install_name_tool -change /usr/local/opt/boost/lib/libboost_system.dylib @executable_path/libboost_system.dylib ./airspaceconverter 88 | install_name_tool -change /usr/local/opt/boost/lib/libboost_filesystem.dylib @executable_path/libboost_filesystem.dylib ./airspaceconverter 89 | install_name_tool -change /usr/local/opt/boost/lib/libboost_locale-mt.dylib @executable_path/libboost_locale-mt.dylib ./airspaceconverter 90 | 91 | # Tell the GUI executable to use the libraries in the same folder 92 | install_name_tool -change /usr/local/lib/libairspaceconverter.dylib @executable_path/libairspaceconverter.dylib ./airspaceconverter-gui 93 | install_name_tool -change /usr/local/opt/libzip/lib/libzip.5.dylib @executable_path/libzip.5.dylib ./airspaceconverter-gui 94 | install_name_tool -change /usr/local/opt/boost/lib/libboost_system.dylib @executable_path/libboost_system.dylib ./airspaceconverter-gui 95 | install_name_tool -change /usr/local/opt/boost/lib/libboost_filesystem.dylib @executable_path/libboost_filesystem.dylib ./airspaceconverter-gui 96 | install_name_tool -change /usr/local/opt/boost/lib/libboost_locale-mt.dylib @executable_path/libboost_locale-mt.dylib ./airspaceconverter-gui 97 | install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets @executable_path/QtWidgets ./airspaceconverter-gui 98 | install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @executable_path/QtGui ./airspaceconverter-gui 99 | install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @executable_path/QtCore ./airspaceconverter-gui 100 | 101 | # Tell libairspaceconverter.dylib to use the libraries in the same folder 102 | install_name_tool -change /usr/local/opt/libzip/lib/libzip.5.dylib @loader_path/libzip.5.dylib ./libairspaceconverter.dylib 103 | install_name_tool -change /usr/local/opt/boost/lib/libboost_filesystem.dylib @loader_path/libboost_filesystem.dylib ./libairspaceconverter.dylib 104 | install_name_tool -change /usr/local/opt/boost/lib/libboost_system.dylib @loader_path/libboost_system.dylib ./libairspaceconverter.dylib 105 | install_name_tool -change /usr/local/opt/boost/lib/libboost_locale-mt.dylib @loader_path/libboost_locale-mt.dylib ./libairspaceconverter.dylib 106 | 107 | # Tell Boost locale library to use the libraries in the same folder 108 | chmod u+w libboost_locale-mt.dylib 109 | install_name_tool -change /usr/local/opt/icu4c/lib/libicudata.64.dylib @loader_path/libicudata.64.dylib ./libboost_locale-mt.dylib 110 | install_name_tool -change /usr/local/opt/icu4c/lib/libicui18n.64.dylib @loader_path/libicui18n.64.dylib ./libboost_locale-mt.dylib 111 | install_name_tool -change /usr/local/opt/icu4c/lib/libicuuc.64.dylib @loader_path/libicuuc.64.dylib ./libboost_locale-mt.dylib 112 | 113 | # And also for the Qt libs 114 | install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @loader_path/QtCore ./QtGui 115 | install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore @loader_path/QtCore ./QtWidgets 116 | install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui @loader_path/QtGui ./QtWidgets 117 | 118 | # Set executables and libraries permissions 119 | chmod a-w * 120 | chmod a+x * 121 | 122 | # Get out 123 | cd ../../.. 124 | 125 | echo "Make macOS application bundle done." 126 | -------------------------------------------------------------------------------- /src/AirspaceConverter.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | 15 | #ifndef VERSION 16 | #define VERSION "0.4.3" 17 | #endif 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | class Airspace; 26 | class Altitude; 27 | class Waypoint; 28 | class RasterMap; 29 | 30 | class AirspaceConverter { 31 | public: 32 | enum OutputType { 33 | KMZ_Format = 0, 34 | OpenAir_Format, 35 | SeeYou_Format, 36 | CSV_Format, 37 | Polish_Format, 38 | Garmin_Format, 39 | Unknown_Format 40 | }; 41 | 42 | AirspaceConverter(); 43 | ~AirspaceConverter(); 44 | 45 | static std::function LogMessage; 46 | static std::function LogWarning; 47 | static std::function LogError; 48 | static std::function cGPSmapper; 49 | 50 | inline static void SetLogMessageFunction(std::function func) { LogMessage = func; } 51 | inline static void SetLogWarningFunction(std::function func) { LogWarning = func; } 52 | inline static void SetLogErrorFunction(std::function func) { LogError = func; } 53 | inline static void Set_cGPSmapperFunction(std::function func) { cGPSmapper = func; } 54 | inline static bool Is_cGPSmapperAvailable() { return !cGPSmapperCommand.empty(); } 55 | static double FrequencyMHz(const int& frequencyHz) { return 0.000001 * frequencyHz; } 56 | static double FrequencykHz(const int& frequencyHz) { return 0.001 * frequencyHz; } 57 | static std::istream& SafeGetline(std::istream& is, std::string& line, bool& isCRLF); 58 | static OutputType DetermineType(const std::string& filename); 59 | static bool PutTypeExtension(const OutputType type, std::string& filename); 60 | static bool ParseAltitude(const std::string& text, const bool isTop, Airspace& airspace); 61 | inline static bool isDigit(const char c) { return (c >= '0' && c <= '9'); } 62 | static std::string GetCurrentDateString(); 63 | static std::string GetFullCreationDateTimeString(); 64 | static bool CheckAirbandFrequency(const double& frequencyMHz, int& frequencyHz); 65 | static bool CheckVORfrequency(const double& frequencyMHz, int& frequencyHz); 66 | static bool CheckNDBfrequency(const double& frequencykHz, int& frequencyHz); 67 | inline void AddAirspaceFile(const std::string& inputFile) { airspaceFiles.push_back(inputFile); } 68 | inline void AddWaypointFile(const std::string& waypointsFile) { waypointFiles.push_back(waypointsFile); } 69 | inline void AddTerrainRasterMapFile(const std::string& rasterMapFile) { terrainRasterMapFiles.push_back(rasterMapFile); } 70 | inline int GetNumberOfAirspaceFiles() const { return (int)airspaceFiles.size(); } 71 | inline int GetNumberOfWaypointFiles() const { return (int)waypointFiles.size(); } 72 | void LoadAirspaces(const OutputType suggestedTypeForOutputFilename = OutputType::KMZ_Format); 73 | void LoadTerrainRasterMaps(); 74 | void UnloadAirspaces(); 75 | void UnloadRasterMaps(); 76 | void LoadWaypoints(); 77 | void UnloadWaypoints(); 78 | void SetQNH(const double newQNHhPa); 79 | double GetQNH() const; 80 | static bool AddTerrainMap(const std::string& filename); 81 | inline static int GetNumOfTerrainMaps() { return (int)terrainMaps.size(); } 82 | static bool GetTerrainAltitudeMt(const double& lat, const double& lon, double& alt); 83 | static void ClearTerrainMaps(); 84 | inline static void SetDefaultTerrainAlt(const double& defaultAltMt) { defaultTerrainAltitudeMt = defaultAltMt; } 85 | inline static double GetDefaultTerrainAlt() { return defaultTerrainAltitudeMt; } 86 | bool Convert(); 87 | inline bool IsConversionDone() const { return conversionDone; } 88 | inline OutputType GetOutputType() const { return DetermineType(outputFile); } 89 | inline bool SetOutputType(const OutputType type) { return PutTypeExtension(type, outputFile); } 90 | inline void SetOutputFile(const std::string& outputFilename) { outputFile = outputFilename; } 91 | inline std::string GetOutputFile() const { return outputFile; } 92 | inline unsigned long GetNumOfAirspaces() const { return (unsigned long)airspaces.size(); } 93 | inline unsigned long GetNumOfWaypoints() const { return (unsigned long)waypoints.size(); } 94 | bool FilterOnLatLonLimits(const double& topLat, const double& bottomLat, const double& leftLon, const double& rightLon); 95 | bool FilterOnAltitudeLimits(const Altitude& floor, const Altitude& ceiling); 96 | inline void ProcessTracksAsAirspaces(const bool treatTracksAsAirspaces = true) { processLineStrings = treatTracksAsAirspaces; } 97 | static void DoNotCalculateArcsAndCirconferences(const bool doNotCalcArcs = true); 98 | static void SetOpenAirCoodinatesAutomatic(); 99 | static void SetOpenAirCoodinatesInDecimalMinutes(); 100 | static void SetOpenAirCoodinatesInSeconds(); 101 | static bool VerifyAltitudeOnTerrainMap(const double& lat, const double& lon, float& alt, const bool& blankAltitude, const bool& altitudeParsed, const int& line, const bool isSpike = false); 102 | static bool CheckForNewVersion(int& versionDifference); 103 | 104 | static const std::vector disclaimer; 105 | static const std::string basePath; 106 | static const std::string cGPSmapperCommand; 107 | 108 | private: 109 | static void DefaultLogMessage(const std::string& text); 110 | static void DefaultLogWarning(const std::string& text); 111 | static void DefaultLogError(const std::string& text); 112 | static bool Default_cGPSmapper(const std::string& polishFile, const std::string& outputFile); 113 | static const std::string Detect_cGPSmapperPath(); 114 | static int VersionToNumber(const std::string& vesionString); 115 | 116 | std::multimap airspaces; 117 | std::multimap waypoints; 118 | static std::vector terrainMaps; 119 | static double defaultTerrainAltitudeMt; 120 | std::string outputFile; 121 | std::vector airspaceFiles, terrainRasterMapFiles, waypointFiles; 122 | bool conversionDone; 123 | bool processLineStrings; 124 | }; 125 | -------------------------------------------------------------------------------- /makeAppImage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # makeAppImage.sh: Copyright 2024-2025 Valerio Messina efa@iol.it 3 | # makeAppImage is part of AirspaceConverter - convert different airspace/waypoint formats 4 | # AirspaceConverter is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # AirspaceConverter is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with AirspaceConverter. If not, see . 16 | # 17 | # Script to generate a Linux AppImage portable package of 'AirspaceConverter' 18 | # used on: Linux=>bin64, Linux=>bin32 19 | # 20 | # Syntax: $ makeAppImage.sh [-y] 21 | 22 | makever=2025-08-22 23 | 24 | DSTPATH="." # path where create the Linux package directory 25 | 26 | echo "makeAppImage: Create a Linux AppImage package for AirspaceConverter ..." 27 | 28 | # check for external dependency compliance 29 | flag=0 30 | for extCmd in chmod cp cut getconf grep mkdir mv pwd rm tr uname wget ; do 31 | exist=`which $extCmd 2> /dev/null` 32 | if (test "" = "$exist") then 33 | echo "Required external dependency: "\"$extCmd\"" unsatisfied!" 34 | flag=1 35 | fi 36 | done 37 | if [[ "$flag" = 1 ]]; then 38 | echo "ERROR: makeAppImage Install the required packages and retry. Exit" 39 | exit 40 | fi 41 | 42 | if [[ "$1" = "-y" ]]; then 43 | batch=1 44 | shift 45 | fi 46 | if [[ "$1" != "" ]]; then 47 | echo "ERROR: makeAppImage no parameter are needed" 48 | echo "Syntax: $ makeAppImage.sh [-y]" 49 | echo " -y for bath execution, no confirmation" 50 | exit 51 | fi 52 | 53 | PKG="Linux" # target OS from Make 54 | CPU=`uname -m` # i686 or x86_64 55 | if (test "" = "$2") then 56 | BIT=$(getconf LONG_BIT) 57 | else 58 | BIT="$2" 59 | fi 60 | if (test "$CPU" = "x86_64" && test "$BIT" = "32") then 61 | CPU=i686 62 | fi 63 | OS=`uname` # current OS 64 | if (test "$OS" != "Darwin") then 65 | OS=`uname -o` # Msys or GNU/Linux, illegal on macOS 66 | fi 67 | VER=`grep "define VERSION" src/AirspaceConverter.hpp | cut -d' ' -f3 | tr -d '"'` 68 | DATE=`date -I` 69 | DIR=`pwd` 70 | BIN=Release 71 | DEP="" # optional deps 72 | TGT=$PKG # target OS 73 | DMG="" 74 | DST="AirspaceConverter${VER}_${DATE}_${TGT}_${CPU}_${BIT}bit" 75 | 76 | if [[ "$OS" != "GNU/Linux" ]]; then 77 | echo "ERROR: makeAppImage do not work on OS different than Linux" 78 | exit 79 | fi 80 | 81 | echo "PKG : $PKG" 82 | echo "CPU : $CPU" 83 | echo "BIT : $BIT" 84 | echo "OS : $OS" 85 | echo "VER : $VER" 86 | echo "DIR : $DIR" 87 | echo "BIN : $BIN" 88 | echo "DEP : $DEP" 89 | echo "TGT : $TGT" 90 | echo "DATE: $DATE" 91 | echo "DST : $DSTPATH/$DST" 92 | if [[ "$batch" != "1" ]]; then 93 | read -p "Proceed? A key to continue" 94 | fi 95 | echo "" 96 | 97 | echo "makeAppImage: Creating AirspaceConverter $VER package for $CPU $TGT $BIT bit ..." 98 | 99 | rm -rf AppDir 100 | mkdir -p AppDir/usr/bin 101 | mkdir -p AppDir/usr/lib 102 | mkdir -p AppDir/usr/share/man/man1 103 | mkdir -p AppDir/usr/share/airspaceconverter/icons 104 | mkdir -p AppDir/usr/share/pixmaps 105 | 106 | # copy binaries: 107 | cp -a $BIN/airspaceconverter AppDir/usr/bin/ 108 | cp -a $BIN/airspaceconverter-gui AppDir/usr/bin/ 109 | # copy libraries: 110 | cp -a $BIN/libairspaceconverter.so AppDir/usr/lib/ 111 | # copy resources: 112 | gzip -9 -n < airspaceconverter.1 > airspaceconverter.1.gz 113 | mv airspaceconverter.1.gz AppDir/usr/share/man/man1 114 | cp -a icons/* AppDir/usr/share/airspaceconverter/icons 115 | cp -a airspaceconverter.xpm AppDir/usr/share/pixmaps 116 | cp -a AirspaceConverter.png AppDir/ 117 | cp -a LICENSE AppDir/ 118 | echo '[Desktop Entry] 119 | Version=1.0 120 | Type=Application 121 | Name=AirspaceConverter 122 | Comment=tool to convert between different airspace and waypoint formats 123 | Exec=airspaceconverter-gui 124 | Terminal=false 125 | StartupNotify=false 126 | Icon=AirspaceConverter 127 | Categories=Education;Science;Geoscience' > airspaceconverter-gui.desktop 128 | cp -a airspaceconverter-gui.desktop AppDir/ 129 | 130 | if (test "$PKG" = "Linux" && (test "$CPU" = "x86_64" || test "$CPU" = "i686")) then # skip on ARM&RISC-V 131 | echo "makeAppImage: Generating the AppImage for AirspaceConverter (about 1') ..." 132 | if (test -f logWget$DATE.txt) then { rm logWget$DATE.txt ; } fi 133 | if (test "$BIT" = "64") then 134 | if (! test -x linuxdeploy-x86_64.AppImage) then 135 | wget -nv "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" 2>> logWget$DATE.txt 136 | chmod +x linuxdeploy-x86_64.AppImage 137 | fi 138 | if (! test -x linuxdeploy-plugin-qt-x86_64.AppImage) then 139 | wget -nv "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" 2>> logWget$DATE.txt 140 | chmod +x linuxdeploy-plugin-qt-x86_64.AppImage 141 | fi 142 | if (! test -x linuxdeploy-plugin-appimage-x86_64.AppImage) then 143 | wget -nv "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage" 2>> logWget$DATE.txt 144 | chmod +x linuxdeploy-plugin-appimage-x86_64.AppImage 145 | fi 146 | rm -f AirspaceConverter-x86_64.AppImage 2> /dev/null 147 | export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR/$BIN" 148 | ./linuxdeploy-x86_64.AppImage -e $BIN/airspaceconverter-gui -l $BIN/libairspaceconverter.so --appdir AppDir -p qt -i AirspaceConverter.png -d airspaceconverter-gui.desktop --output appimage > logLinuxdeploy$DATE.txt 149 | if (test -f AirspaceConverter-x86_64.AppImage) then 150 | file=$DST.AppImage 151 | mv AirspaceConverter-x86_64.AppImage $file 152 | echo "AppImage created: $file" 153 | else 154 | echo "AppImage creation error, see log: logLinuxdeploy$DATE.txt" 155 | fi 156 | fi 157 | if (test "$BIT" = "32") then 158 | echo "As now skip AppImage at 32 bit" 159 | fi 160 | fi 161 | if [[ "$batch" != "1" ]]; then 162 | read -p "Delete tmp file and AppDir directory? (y/n) " ret 163 | fi 164 | #echo "ret:$ret" 165 | if (test "$ret" = "y") then 166 | rm airspaceconverter-gui.desktop 167 | rm -rf AppDir 168 | fi 169 | -------------------------------------------------------------------------------- /src/RasterMap.cpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc, LK8000 team 8 | // License : GNU GPL v3 9 | // 10 | // The source code in this file was adopted from LK8000 project 11 | // 12 | // LK8000 Tactical Flight Computer - WWW.LK8000.IT 13 | // Released under GNU/GPL License v.2 14 | // See CREDITS.TXT file in LK8000 project for authors and copyrights 15 | // LK8000 Repository: https://github.com/LK8000/LK8000.git 16 | // 17 | //============================================================================ 18 | 19 | #include "RasterMap.hpp" 20 | #include "AirspaceConverter.hpp" 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | RasterMap::RasterMap() : 27 | terrain_valid(false), 28 | max_field_value(0), 29 | xlleft(0), 30 | xlltop(0), 31 | DirectFine(false), 32 | DirectAccess(true), 33 | Paged(false), 34 | fXrounding(0.0), 35 | fYrounding(0.0), 36 | fXroundingFine(0.0), 37 | fYroundingFine(0.0), 38 | Xrounding(0), 39 | Yrounding(0), 40 | TerrainMem(nullptr) { 41 | } 42 | 43 | RasterMap::~RasterMap() { 44 | Close(); 45 | } 46 | 47 | bool RasterMap::GetMapCenter(double *lon, double *lat) const { 48 | if (!terrain_valid) return false; 49 | *lon = (TerrainInfo.Left + TerrainInfo.Right) / 2; 50 | *lat = (TerrainInfo.Top + TerrainInfo.Bottom) / 2; 51 | return true; 52 | } 53 | 54 | // more accurate method 55 | /*int RasterMap::GetEffectivePixelSize(double *pixel_D, double latitude, double longitude) const { 56 | double terrain_step_x, terrain_step_y; 57 | double step_size = TerrainInfo.StepSize*sqrt(2.0); 58 | if ((*pixel_D <= 0) || (step_size == 0)) { 59 | *pixel_D = 1.0; 60 | return 1; 61 | } 62 | // how many steps are in the pixel size 63 | 64 | //TODO DistanceBearing(latitude, longitude, latitude + step_size,longitude, &terrain_step_x, NULL); 65 | 66 | terrain_step_x = fabs(terrain_step_x); 67 | 68 | //TODO DistanceBearing(latitude, longitude, latitude,longitude + step_size, &terrain_step_y, NULL); 69 | 70 | terrain_step_y = fabs(terrain_step_y); 71 | double rfact = max(terrain_step_x, terrain_step_y) / (*pixel_D); 72 | int epx = (int)(max(1.0, ceil(rfact))); 73 | // *pixel_D = (*pixel_D)*rfact/epx; 74 | return epx; 75 | }*/ 76 | 77 | 78 | inline static int iround(double i) { 79 | return (int)(std::floor(i + 0.5)); 80 | } 81 | 82 | void RasterMap::SetFieldRounding(double xr, double yr) { 83 | if (!terrain_valid) return; 84 | Xrounding = iround(xr / TerrainInfo.StepSize); 85 | Yrounding = iround(yr / TerrainInfo.StepSize); 86 | if (Xrounding<1) Xrounding = 1; 87 | fXrounding = 1.0 / (Xrounding*TerrainInfo.StepSize); 88 | fXroundingFine = fXrounding*256.0; 89 | if (Yrounding<1) Yrounding = 1; 90 | fYrounding = 1.0 / (Yrounding*TerrainInfo.StepSize); 91 | fYroundingFine = fYrounding*256.0; 92 | if ((Xrounding == 1) && (Yrounding == 1)) { 93 | DirectFine = true; 94 | xlleft = (int)(TerrainInfo.Left*fXroundingFine) + 128; 95 | xlltop = (int)(TerrainInfo.Top*fYroundingFine) - 128; 96 | } else DirectFine = false; 97 | } 98 | 99 | bool RasterMap::GetTerrainHeight(const double& Latitude, const double& Longitude, short& terrainHeight) const { 100 | if (!terrain_valid) return false; 101 | if (DirectFine) return GetFieldAtXY((int)(Longitude * fXroundingFine) - xlleft, xlltop - (int)(Latitude * fYroundingFine), terrainHeight); 102 | else { 103 | const unsigned int ix = ((int)((Longitude - TerrainInfo.Left) * fXrounding)) * Xrounding; 104 | const unsigned int iy = ((int)((TerrainInfo.Top - Latitude) * fYrounding)) * Yrounding; 105 | return GetFieldAtXY(ix << 8, iy << 8, terrainHeight); 106 | } 107 | } 108 | 109 | inline unsigned int CombinedDivAndMod(unsigned int &lx) { 110 | unsigned int ox = lx & 0xff; 111 | lx = lx >> 8; 112 | return ox; 113 | } 114 | 115 | bool RasterMap::GetFieldAtXY(unsigned int lx, unsigned int ly, short& result) const { 116 | const unsigned ix = CombinedDivAndMod(lx); 117 | if (lx + 1 >= TerrainInfo.Columns) return false; 118 | const unsigned iy = CombinedDivAndMod(ly); 119 | if (ly + 1 >= TerrainInfo.Rows) return false; 120 | const short *tm = TerrainMem + ly * TerrainInfo.Columns + lx; 121 | 122 | // perform piecewise linear interpolation 123 | const short &h1 = tm[0]; // (x,y) 124 | const short &h3 = tm[TerrainInfo.Columns + 1]; // (x+1,y+1) 125 | if (ix > iy) { 126 | // lower triangle 127 | const short &h2 = tm[1]; // (x+1,y) 128 | result = (short)(h1 + ((ix * (h2 - h1) - iy * (h2 - h3)) >> 8)); 129 | } else { 130 | // upper triangle 131 | const short &h4 = tm[TerrainInfo.Columns]; // (x,y+1) 132 | result = (short)(h1 + ((iy * (h4 - h1) - ix * (h4 - h3)) >> 8)); 133 | } 134 | return true; 135 | } 136 | 137 | bool RasterMap::Open(const std::string& filename) { 138 | Close(); 139 | std::ifstream input(filename, std::ios::in | std::ios::binary); 140 | if (!input.is_open() || !input.good()) { 141 | AirspaceConverter::LogError("Falied to open raster map file: " + filename); 142 | return false; 143 | } 144 | AirspaceConverter::LogMessage("Reading raster map: " + filename); 145 | 146 | input.read((char*)&TerrainInfo, sizeof(TERRAIN_INFO)); 147 | if (!input || input.gcount() != sizeof(TERRAIN_INFO) || TerrainInfo.StepSize == 0) { 148 | input.close(); 149 | AirspaceConverter::LogError("Loading raster map failed: invalid header."); 150 | return false; 151 | } 152 | 153 | size_t nValues = static_cast(TerrainInfo.Rows) * TerrainInfo.Columns; 154 | size_t size = nValues * sizeof(short); 155 | 156 | // Allocate the terrain map 157 | TerrainMem = (short*)std::malloc(size); 158 | if (TerrainMem == nullptr) { 159 | input.close(); 160 | AirspaceConverter::LogError("Loading raster map failed: memory allocation failure."); 161 | assert(false); 162 | return false; 163 | } 164 | 165 | input.read((char*)TerrainMem, size); 166 | if (!input || input.gcount() != (long int)size) { 167 | AirspaceConverter::LogError("Loading raster map failed: size doesn't match size declared in the header."); 168 | input.close(); 169 | Close(); 170 | return false; 171 | } 172 | 173 | for (size_t i = 0; i= TerrainInfo.Bottom && 191 | longitude >= TerrainInfo.Left && longitude <= TerrainInfo.Right); 192 | } 193 | -------------------------------------------------------------------------------- /src/Airspace.hpp: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // AirspaceConverter 3 | // Since : 14/6/2016 4 | // Author : Alberto Realis-Luc 5 | // Web : https://www.alus.it/AirspaceConverter 6 | // Repository : https://github.com/alus-it/AirspaceConverter.git 7 | // Copyright : (C) 2016 Alberto Realis-Luc 8 | // License : GNU GPL v3 9 | // 10 | // This source file is part of AirspaceConverter project 11 | //============================================================================ 12 | 13 | #pragma once 14 | #include 15 | #include 16 | #include "Geometry.hpp" 17 | #include "Altitude.hpp" 18 | 19 | class Airspace { 20 | public: 21 | typedef enum { 22 | CLASSA = 0, // Airspace class A 23 | CLASSB, // Airspace class B 24 | CLASSC, // Airspace class C 25 | CLASSD, // Airspace class D 26 | CLASSE, // Airspace class E 27 | CLASSF, // Airspace class F 28 | CLASSG, // Airspace class G 29 | D, // Danger area 30 | P, // Prohibited area 31 | R, // Restricted area 32 | CTR, // Control Traffic Region 33 | TMZ, // Transponder Mandatory Zone 34 | RMZ, // Radio Mandatory Zone 35 | GLIDING, // Gliding area 36 | NOGLIDER, // No gliding area 37 | WAVE, // Wave window 38 | NOTAM, // Notice to Airmen "NOTAM" airspace category can be used in OpenAir files 39 | OTHER, // Generic other type 40 | TMA, // Terminal Manoeuvring Area 41 | FIR, // Flight Information Region, from here on not visible by default 42 | UIR, // Upper Information Region 43 | OTH, // Over The Horizon 44 | AWY, // Airway 45 | MATZ, // Military Aerodrome Traffic Zone 46 | MTMA, // Military Terminal Zone 47 | MTRA, // Military Temporary Reserved Area 48 | TFR, // Temporary Flight Restriction 49 | ADA, // Advisory Area 50 | ADIZ, // Air Defense Identification Zone 51 | CTA, // Control Area 52 | DFIR, // Delegated FIR 53 | TIZ, // Traffic Information Zone 54 | TIA, // Traffic Information Area 55 | SRZ, // Special Rules Zone 56 | ATZ, // Aerodrome Traffic Zone 57 | FISA, // Flight Information Service Area 58 | MBZ, // Mandatory Broadcast Zone 59 | ASR, // Aerial Sporting and Recreation Area 60 | COMP, // Competition boundary 61 | TRZ, // Transponder Recommended Zone 62 | VFRR, // VFR Route 63 | RTZ, // Radio/Transponder Mandatory zone 64 | PARA, // Parachute jumping area 65 | LFZ, // Low Flying Zone 66 | CFZ, // Common Frequency Zone 67 | MOA, // Military Operating Area 68 | MTA, // Military Training Area 69 | TSA, // Temporary segregated airspace 70 | TRA, // Temporary reserved airspace 71 | UNKNOWN, // "UNKNOWN" as well can be used in OpenAir files 72 | UNDEFINED // also the last one 73 | } Type; 74 | 75 | Airspace() : type(UNDEFINED), airspaceClass(UNDEFINED), transponderCode(-1) {} 76 | Airspace(Type category); 77 | Airspace(const Airspace& orig); 78 | Airspace(Airspace&& orig); 79 | ~Airspace(); 80 | 81 | Airspace& operator=(const Airspace& other); 82 | bool operator==(const Airspace& other) const; 83 | inline static const std::string& CategoryName(const Type& category) { return CATEGORY_NAMES[category]; } 84 | inline static const std::string& LongCategoryName(const Type& category) { return LONG_CATEGORY_NAMES[category]; } 85 | static bool CategoryVisibleByDefault(const Type& category) { return CATEGORY_VISIBILITY[category]; } 86 | void SetType(const Type& category); 87 | void SetClass(const Type& airspClass); 88 | bool GuessClassFromName(); 89 | bool NameStartsWithIdent(const std::string& ident); 90 | inline void SetTopAltitude(const Altitude& alt) { top = alt; } 91 | inline void SetBaseAltitude(const Altitude& alt) { base = alt; } 92 | inline void SetName(const std::string& airspaceName) { name = airspaceName; } 93 | bool SetTransponderCode(const std::string& code); 94 | void AddRadioFrequency(const int frequencyHz, const std::string& description); 95 | void Clear(); // Clear name, type, points and geometries 96 | void ClearPoints(); // Clear points and geometries 97 | void ClearGeometries(); // Clear geometries only 98 | bool AddPoint(const Geometry::LatLon& point); 99 | bool AddPointLatLonOnly(const double& lat, const double& lon); 100 | void AddGeometry(const Geometry* geometry); 101 | bool ClosePoints(); 102 | bool ArePointsValid() const; 103 | void RemoveTooCloseConsecutivePoints(); 104 | bool Undiscretize(); 105 | bool IsWithinLatLonLimits(const Geometry::Limits& limits) const; 106 | bool IsWithinAltLimits(const Altitude& floor, const Altitude& ceil) const; 107 | inline void CutPointsFrom(Airspace& orig) { points = std::move(orig.points); } 108 | inline const Type& GetType() const { return type; } 109 | inline const Type& GetClass() const { return airspaceClass; } 110 | inline const std::string& GetCategoryName() const { return CategoryName(type); } 111 | inline const std::string& GetLongCategoryName() const { return LongCategoryName(type); } 112 | inline const Altitude& GetTopAltitude() const { return top; } 113 | inline const Altitude& GetBaseAltitude() const { return base; } 114 | inline const std::string& GetName() const { return name; } 115 | inline size_t GetNumberOfGeometries() const { return geometries.size(); } 116 | inline const Geometry* GetGeometryAt(size_t i) { return i < geometries.size() ? geometries.at(i) : nullptr; } 117 | inline const std::vector& GetPoints() const { return points; } 118 | inline const Geometry::LatLon& GetFirstPoint() const { return points.front(); } 119 | inline const Geometry::LatLon& GetLastPoint() const { return points.back(); } 120 | inline size_t GetNumberOfPoints() const { return points.size(); } 121 | inline const Geometry::LatLon& GetPointAt(size_t pos) const { return points.at(pos); } 122 | inline bool IsGNDbased() const { return base.IsGND(); } 123 | inline bool IsMSLbased() const { return base.IsMSL(); } 124 | inline bool IsAGLtopped() const { return top.IsAGL(); } 125 | inline bool IsAMSLtopped() const { return top.IsAMSL(); } 126 | inline bool IsVisibleByDefault() const { return CategoryVisibleByDefault(type); } 127 | inline size_t GetNumberOfRadioFrequencies() const { return radioFrequencies.size(); } 128 | inline const std::pair& GetRadioFrequencyAt(size_t pos) const { return radioFrequencies.at(pos); } 129 | std::string GetTransponderCode() const; 130 | inline bool HasTransponderCode() const { return transponderCode >= 0; } 131 | void CalculateSurface(double& areaKm2, double& perimeterKm) const; 132 | 133 | private: 134 | bool AddPointGeometryOnly(const Geometry::LatLon& point); 135 | void EvaluateAndAddArc(std::vector& arcPoints, std::vector>& centerPoints, const bool& clockwise); 136 | void EvaluateAndAddCircle(const std::vector& arcPoints, const std::vector>& centerPoints); 137 | 138 | static const std::string CATEGORY_NAMES[]; 139 | static const std::string LONG_CATEGORY_NAMES[]; 140 | static const bool CATEGORY_VISIBILITY[]; 141 | Altitude top, base; 142 | std::vector geometries; 143 | std::vector points; 144 | Type type; 145 | Type airspaceClass; // This is to remember the class of a TMA or CTR where possible 146 | std::string name; 147 | std::vector> radioFrequencies; // Radio frequencies list values expressed in [Hz] and name/description 148 | short transponderCode; // Transponder code mandated for this airspace 12 bits used (OCT:7777 = DEC:4095 = BIN:1111111111) 149 | }; 150 | -------------------------------------------------------------------------------- /airspaceconverter.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * Airspace_Infringement_xpm[] = { 3 | "32 32 256 2", 4 | " c None", 5 | ". c #A47FB9", 6 | "+ c #FFFFFF", 7 | "@ c #F9F6F9", 8 | "# c #FFFEFF", 9 | "$ c #FDFCFD", 10 | "% c #F6F1F7", 11 | "& c #ECE3EF", 12 | "* c #FAF7FB", 13 | "= c #F9F6FA", 14 | "- c #F8F5F9", 15 | "; c #EEE6F1", 16 | "> c #F6F1F8", 17 | ", c #F5F0F7", 18 | "' c #F4EFF6", 19 | ") c #F3EEF5", 20 | "! c #E4D8E9", 21 | "~ c #E6DBEB", 22 | "{ c #ECE3F0", 23 | "] c #EBE2EF", 24 | "^ c #B89AC7", 25 | "/ c #D4C1DD", 26 | "( c #DECFE5", 27 | "_ c #DCCDE3", 28 | ": c #DED0E5", 29 | "< c #E1D4E7", 30 | "[ c #E2D5E8", 31 | "} c #E8DEED", 32 | "| c #E7DDEC", 33 | "1 c #E6DCEB", 34 | "2 c #F3EDF6", 35 | "3 c #F2ECF5", 36 | "4 c #F1EBF4", 37 | "5 c #F0EAF3", 38 | "6 c #FBF9FC", 39 | "7 c #FAF8FB", 40 | "8 c #9C73B3", 41 | "9 c #9E75B4", 42 | "0 c #9E76B4", 43 | "a c #9D75B3", 44 | "b c #A079B5", 45 | "c c #A27BB7", 46 | "d c #A37DB8", 47 | "e c #A27CB7", 48 | "f c #A47EB9", 49 | "g c #A681BA", 50 | "h c #A580B9", 51 | "i c #A883BC", 52 | "j c #A682BA", 53 | "k c #A883BB", 54 | "l c #A783BB", 55 | "m c #A884BB", 56 | "n c #AA87BD", 57 | "o c #AC89BF", 58 | "p c #AB88BE", 59 | "q c #AC8ABF", 60 | "r c #AA88BD", 61 | "s c #AD8BC0", 62 | "t c #AD8BBF", 63 | "u c #B08FC2", 64 | "v c #AF8EC1", 65 | "w c #B291C4", 66 | "x c #B291C3", 67 | "y c #B292C3", 68 | "z c #B090C1", 69 | "A c #B495C5", 70 | "B c #B698C6", 71 | "C c #BA9DCA", 72 | "D c #B99CC9", 73 | "E c #B89BC8", 74 | "F c #B79AC7", 75 | "G c #BA9DC9", 76 | "H c #BC9FCB", 77 | "I c #BA9EC9", 78 | "J c #BEA3CD", 79 | "K c #BDA2CC", 80 | "L c #BCA1CB", 81 | "M c #C0A6CE", 82 | "N c #C2A9D0", 83 | "O c #C1A8CF", 84 | "P c #C3AAD1", 85 | "Q c #C4ABD1", 86 | "R c #C5ADD2", 87 | "S c #C4ACD1", 88 | "T c #C9B2D5", 89 | "U c #C8B1D4", 90 | "V c #C7B0D3", 91 | "W c #CAB3D6", 92 | "X c #CCB7D7", 93 | "Y c #CEB9D9", 94 | "Z c #CFBBDA", 95 | "` c #CEBAD9", 96 | " . c #D4C1DE", 97 | ".. c #D3C1DD", 98 | "+. c #D2C0DC", 99 | "@. c #D4C3DD", 100 | "#. c #D8C7E1", 101 | "$. c #D6C5DF", 102 | "%. c #D9CAE1", 103 | "&. c #DCCDE4", 104 | "*. c #DBCCE3", 105 | "=. c #E0D3E7", 106 | "-. c #E5DAEB", 107 | ";. c #E4D9EA", 108 | ">. c #E3D8E9", 109 | ",. c #E9E0EE", 110 | "'. c #EAE1EF", 111 | "). c #9B72B3", 112 | "!. c #9D75B4", 113 | "~. c #9E77B5", 114 | "{. c #9F78B5", 115 | "]. c #A17AB7", 116 | "^. c #9F79B6", 117 | "/. c #A079B6", 118 | "(. c #A27BB8", 119 | "_. c #A27CB8", 120 | ":. c #A17CB7", 121 | "<. c #A47FBA", 122 | "[. c #A37EB9", 123 | "}. c #A581BA", 124 | "|. c #A783BC", 125 | "1. c #A784BC", 126 | "2. c #A987BE", 127 | "3. c #AA87BE", 128 | "4. c #A986BD", 129 | "5. c #A885BC", 130 | "6. c #AB8ABF", 131 | "7. c #AD8CC0", 132 | "8. c #AE8DC1", 133 | "9. c #AF8FC2", 134 | "0. c #B191C4", 135 | "a. c #B192C4", 136 | "b. c #B091C3", 137 | "c. c #AF90C2", 138 | "d. c #B293C4", 139 | "e. c #B192C3", 140 | "f. c #B495C6", 141 | "g. c #B394C5", 142 | "h. c #B496C5", 143 | "i. c #B597C6", 144 | "j. c #B699C7", 145 | "k. c #B598C6", 146 | "l. c #B79AC8", 147 | "m. c #B99DCA", 148 | "n. c #BBA0CB", 149 | "o. c #BA9FCA", 150 | "p. c #BCA1CC", 151 | "q. c #BDA3CD", 152 | "r. c #BEA4CD", 153 | "s. c #BFA5CE", 154 | "t. c #C1A8D0", 155 | "u. c #BFA6CE", 156 | "v. c #C3ACD1", 157 | "w. c #C6AFD4", 158 | "x. c #C5AED3", 159 | "y. c #C7B0D4", 160 | "z. c #C6AFD3", 161 | "A. c #C9B3D6", 162 | "B. c #C9B4D6", 163 | "C. c #CCB7D8", 164 | "D. c #CBB6D7", 165 | "E. c #CAB5D6", 166 | "F. c #C9B4D5", 167 | "G. c #CEB9DA", 168 | "H. c #CDB9D9", 169 | "I. c #D0BDDB", 170 | "J. c #CFBCDA", 171 | "K. c #D3C1DE", 172 | "L. c #D1BFDC", 173 | "M. c #D4C3DE", 174 | "N. c #D3C2DD", 175 | "O. c #D5C4DF", 176 | "P. c #D9C9E2", 177 | "Q. c #D8C8E1", 178 | "R. c #D7C7E0", 179 | "S. c #DACBE3", 180 | "T. c #D9CAE2", 181 | "U. c #DCCEE4", 182 | "V. c #E0D3E8", 183 | "W. c #DFD2E7", 184 | "X. c #DED1E6", 185 | "Y. c #DDD0E5", 186 | "Z. c #E3D7EA", 187 | "`. c #E2D6E9", 188 | " + c #E1D5E8", 189 | ".+ c #F0E9F4", 190 | "++ c #EFE8F3", 191 | "@+ c #EEE7F2", 192 | "#+ c #EDE6F1", 193 | "$+ c #F3EEF6", 194 | "%+ c #A582BB", 195 | "&+ c #BBA0CC", 196 | "*+ c #CDBAD9", 197 | "=+ c #D3C2DE", 198 | "-+ c #D7C8E1", 199 | ";+ c #DBCDE4", 200 | ">+ c #E3D8EA", 201 | ",+ c #E1D6E8", 202 | "'+ c #E8DFEE", 203 | ")+ c #E7DEED", 204 | "!+ c #EBE3F0", 205 | "~+ c #F8F5FA", 206 | "{+ c #F7F4F9", 207 | "]+ c #F6F3F8", 208 | "^+ c #F5F2F7", 209 | "/+ c #D5C5E0", 210 | "(+ c #DDD0E6", 211 | "_+ c #E5DBEC", 212 | ":+ c #EDE6F2", 213 | "<+ c #ECE5F1", 214 | "[+ c #EBE4F0", 215 | "}+ c #F5F1F8", 216 | "|+ c #E5DCEC", 217 | "1+ c #F1ECF5", 218 | "2+ c #F5F2F8", 219 | "3+ c #FAF8FC", 220 | "4+ c #FCFBFD", 221 | "5+ c #FBFAFC", 222 | "6+ c #F7F5FA", 223 | "7+ c #F9F8FB", 224 | "8+ c #FDFDFE", 225 | "9+ c #FEFEFE", 226 | "0+ c #FAFAFA", 227 | "a+ c #F8F8F8", 228 | "b+ c #F7F7F7", 229 | "c+ c #F5F5F5", 230 | "d+ c #F1F1F1", 231 | "e+ c #EBEBEB", 232 | "f+ c #E6E6E6", 233 | "g+ c #E5E5E5", 234 | "h+ c #E2E2E2", 235 | "i+ c #DCDCDC", 236 | "j+ c #D7D7D7", 237 | "k+ c #D3D3D3", 238 | "l+ c #CDCDCD", 239 | "m+ c #C4C4C4", 240 | "n+ c #B7B7B7", 241 | "o+ c #A8A8A8", 242 | "p+ c #9B9B9B", 243 | "q+ c #8C8C8C", 244 | "r+ c #858585", 245 | "s+ c #828282", 246 | "t+ c #808080", 247 | "u+ c #767676", 248 | "v+ c #6A6A6A", 249 | "w+ c #5D5D5D", 250 | "x+ c #565656", 251 | "y+ c #545454", 252 | "z+ c #515151", 253 | "A+ c #444444", 254 | "B+ c #363636", 255 | "C+ c #252525", 256 | "D+ c #1A1A1A", 257 | "E+ c #141414", 258 | "F+ c #0A0A0A", 259 | "G+ c #040404", 260 | " ", 261 | " + + + + + + + + + + + + + + + + + + + + + + + + + + ", 262 | " . . . . . . . . . . . . . . . . . . . + . + . . . . . . ", 263 | " + . . . . . . . . . . . . . . . . . + . . . . 5+. . . . . + ", 264 | " + . . . . . + . + . . . . . . . + . . . . . . . + . . . . + ", 265 | " + . . . . ].+ . . . + + . { . + . . . . . . . . . ].. . . + ", 266 | " + . . . . . . . . . . . . . d.. . . . . . . . . . . + . . + ", 267 | " + . . . + . . . . . . . . . . . . . . . . . . . . . . . . + ", 268 | " + . . . . . . . . . . . . . . . . . . . . . . . . . . @++++ ", 269 | " + . + . . . . . . . . . . . . . . . . . . . . . . . . . + + ", 270 | " + . . . . . . . . . . . . . . . . . . . . . . . . . . . . + ", 271 | " + A . . . . . . . . . . . . . . . . . . . . . . . . . . + + ", 272 | " + . . . . . . . . . . . . . . . . . . . . . . . . . . . . + ", 273 | " + + . . . . . . . . . . . . . . . . . . . . . . . . . + . + ", 274 | " + . . . . . . . . . . . . . . . . . . . . . . . . . {.. . + ", 275 | " + . . + . . . . . . . . . . . . 4.. . . . . . . . . + . . + ", 276 | " + . . . . . . . . . . . . . . /.+ + . . . . . . . . . . . + ", 277 | " + . . . . + . . . . . . . . . . + + b.. . . . . + . . . . + ", 278 | " + . . . . . . . . . . . . . . . . + + . . . . . + . < + . + ", 279 | " + . . . + . . . . . . . . . . . . . + + + + + + + + + + + + ", 280 | " + . . + . . . . . . . . . . . . . . . + + + + + + + + . . + ", 281 | " + . + . . . . . . . . . . . . . . . S.+ + + + + . . . . . + ", 282 | " + . + . . . . . . . . . . . . . . . + + + + + . . . . . . + ", 283 | " + + . . . . . . . . . . . . . . . . + + + + + e . . . . . + ", 284 | " + . . . . . . . . . . . . . . . l + + + . . + + . . . . . + ", 285 | " + + . . . . . . . . . . . . d + . + + + . . . + + + + . . + ", 286 | " + /.+ . . . . . . . . . . + . . . + + . . . . + + + + . . + ", 287 | " + . . + . . . . . . . . + . . . + + M.. . . . + + . . . . + ", 288 | " + . . . + . . . . [.+ . . . . . /.+ . . . . . + . . . . . + ", 289 | " . . . . + . . + . . . . . . . . . . . . . . . . . . . . ", 290 | " + + + + + + + + + + + + + + + + + + + + + + + + + + ", 291 | " "}; 292 | -------------------------------------------------------------------------------- /Windows/AirspaceConverter/AirspaceConverter.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | 14 | 15.0 15 | {AF75346B-F52C-41C5-B762-8A84487874F9} 16 | Win32Proj 17 | AirspaceConverter 18 | 10.0 19 | AirspaceConverter 20 | 21 | 22 | 23 | Application 24 | true 25 | v142 26 | Unicode 27 | 28 | 29 | Application 30 | false 31 | v142 32 | true 33 | Unicode 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | true 49 | C:\local\boost_1_89_0;$(VC_IncludePath);$(WindowsSDK_IncludePath); 50 | C:\local\boost_1_89_0\lib64-msvc-14.2;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 51 | airspaceconverter 52 | $(SolutionDir)$(Configuration)\$(Platform)\ 53 | $(Configuration)\$(Platform)\ 54 | true 55 | 56 | 57 | false 58 | C:\local\boost_1_89_0;$(VC_IncludePath);$(WindowsSDK_IncludePath); 59 | C:\local\boost_1_89_0\lib64-msvc-14.2;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 60 | airspaceconverter 61 | $(SolutionDir)$(Configuration)\$(Platform)\ 62 | $(Configuration)\$(Platform)\ 63 | true 64 | 65 | 66 | 67 | NotUsing 68 | Level3 69 | Disabled 70 | true 71 | _CONSOLE;_WIN32_WINNT=0x0601;_DEBUG;%(PreprocessorDefinitions) 72 | true 73 | stdcpp20 74 | 75 | 76 | Console 77 | true 78 | 79 | 80 | 81 | 82 | NotUsing 83 | Level3 84 | MaxSpeed 85 | true 86 | true 87 | true 88 | _CONSOLE;_WIN32_WINNT=0x0601;NDEBUG;%(PreprocessorDefinitions) 89 | true 90 | stdcpp20 91 | 92 | 93 | Console 94 | true 95 | true 96 | true 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | {1412bb18-5649-411d-b0a2-0a32e6402939} 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /airspaceconverter.1: -------------------------------------------------------------------------------- 1 | .TH AIRSPACECONVERTER 1 2 | .SH NAME 3 | airspaceconverter \- convert between different airspace formats 4 | .SH SYNOPSIS 5 | .B airspaceconverter 6 | [\fB\-q\fR \fIQNH\fR] 7 | [\fB\-a\fR \fIterrainAltitude\fR] 8 | [\fB\-i\fR \fIinputFile\fR] 9 | [\fB\-w\fR \fIwaypointFile\fR] 10 | [\fB\-m\fR \fIterrainMapFile\fR] 11 | [\fB\-l\fR \fInorthLat,southLat,westLon,eastLon\fR] 12 | [\fB\-p\fR] 13 | [\fB\-s\fR] 14 | [\fB\-t\fR] 15 | [\fB\-o\fR \fIoutputFile\fR] 16 | 17 | .PP 18 | Example: airspaceconverter -q 1013 -a 35 -i fileOpenAir.txt -i openAIP_asp.aip -w waypoints.cup -w openAIP_wpt.aip -m terrainMap.dem -l 58,52,0.2,8.4 -o outputFile.kmz 19 | .SH DESCRIPTION 20 | .B airspaceconverter 21 | an open source and multi-platform tool to convert between different airspace and waypoint formats. 22 | .PP 23 | Can read airspace and waypoint files in the following formats: 24 | - OpenAir 25 | - openAIP 26 | - KML/KMZ 27 | - SeeYou 28 | - LittleNavMap 29 | .PP 30 | And the output can be done in the following formats: 31 | - KMZ 32 | - OpenAir 33 | - SeeYou 34 | - LittleNavMap 35 | - Polish 36 | - Garmin IMG 37 | .PP 38 | KMZ files are to be shown in 3D with Google Earth. 39 | AirspaceConverter can take as input also SeeYou .CUP waypoints files and convert them as well in KMZ for Google Earth. 40 | Airspace represented in 3D in Google Earth can help to visualize and better understand the airspace structure. 41 | 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. 42 | .PP 43 | The PFM "Polish" format, (file .mp), can be used with cGPSmapper. This utility uses cGPSmapper to make the .img files for Garmin devices. 44 | .PP 45 | The output in OpenAir is useful to make the data from openAIP suitable for many devices which support OpenAir only format; in particular this feature attempts to recalculate arcs and circles (possible definitions in OpenAir) in order to contain the size of output files. 46 | This software can also be useful for maintainers of OpenAir airspace and SeeYou .CUP waypoints files, not only to visualize airspace and waypoints but also to verify the syntax of OpenAir and CUP commands entered. 47 | 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. 48 | .PP 49 | 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. 50 | This is particularly useful to verify that the position of the airfield in the CUP file matches exactly the runway in Google Earth. 51 | 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 quite important. 52 | .PP 53 | AirspaceConverter can be used also to merge together several airspace files (openAIP repeated airspaces will be automatically removed) and filter the result on a specific range of latitudes and longitudes. 54 | .PP 55 | Converting openAIP files to OpenAir has also the advantage to reduce significantly the size of the total airspace database used on a portable device. 56 | For example LK8000 recently supports also the openAIP format but it is not always possible to load bigger openAIP files on older PNA devices, while the same files converted in OpenAir yes. 57 | .PP 58 | There are also cases where the "official" airspace files are available only in KML format, also in this case is possible to convert it to OpenAir. 59 | .PP 60 | AirspaceConverter uses the same terrain raster maps (.DEM) of LK8000 to get the altitude of the terrain and so to convert altitudes from AGL to AMSL. 61 | In case the loaded terrain maps are overlapping, the one with the best resolution will be automatically used. 62 | On the LK8000 website there is a wide terrain raster map collection. 63 | .PP 64 | For more information visit: https://www.alus.it/AirspaceConverter 65 | .SH OPTIONS 66 | .TP 67 | .BR \-q " " \fIQNH\fR 68 | Specify the QNH in hPa used to calculate height of flight levels. 69 | Default is 1013.15 hPa. 70 | .TP 71 | .BR \-a " " \fIterrainAltitude\fR 72 | Specify a default terrain altitude in meters to calculate AGL heights of points not covered by loaded terrain map(s). 73 | Default is 20 m. 74 | .TP 75 | .BR \-i " " \fIinputFile\fR 76 | Multiple, input airspace file(s) can be OpenAir (.openair, .txt), openAIP (.aip), Google Earth (.kmz, .kml). 77 | At least one input airspace or waypoint file must be present. 78 | Additional input airspace files must be specified repeating the option \-i in front of each of them. 79 | OpenAir input files are expected to be encoded in ANSI but if encoded in UTF-8 with BOM they will be also read properly. 80 | .TP 81 | .BR \-w " " \fIwaypointFile\fR 82 | Multiple, input waypoint file(s) can be SeeYou (.cup), openAIP (.aip) or LittleNavMap (.csv). 83 | At least one input airspace or waypoint file must be present. 84 | Additional input waypoint files must be specified repeating the option \-w in front of each of them. 85 | The waypoints will be used only if converting to KMZ or to SeeYou. 86 | Hotspots files from openAIP are not supported while nav aids and airports yes. 87 | .TP 88 | .BR \-m " " \fIterrainMapFile\fR 89 | Multiple, terrain map file(s) (.dem) used to lookup terrain heights. 90 | Additional input terrain map files must be specified repeating the option \-m in front of each of them. 91 | The terrain maps will be used when converting to KMZ. And when importing SeeYou waypoints with null altitude the corresponding ground elevation will be used. 92 | .TP 93 | .BR \-l " " \fInorthLatitude,southLatitude,westLongitude,eastLongitude\fR 94 | Output filter limits in latitude and longitude, it must be followed by the 4 limit values. 95 | The limits are comma separated, expressed in degrees, without spaces. 96 | Negative values represent south latitudes or west longitudes. 97 | .TP 98 | .BR \-u " " \fIlowAltitude,hiAltitude\fR 99 | Output filter limits in altitude, it must be followed by 1 or 2 limit values. 100 | The limits are comma separated, expressed in feet, without spaces. 101 | If the high limit is omitted it will be considered as unlimited. 102 | .TP 103 | .BR \-o " " \fIoutputFile\fR 104 | Output file, can be: .kmz (Google Earth), .opeair, .txt (OpenAir), .cup (SeeYou), .csv (LittleNavMap), .img (Garmin) or .mp (Polish). 105 | If not specified will be used the name of first input file as KMZ. 106 | Output OpenAir files will be always encoded in ANSI. 107 | WARNING: any already existing output file will be automatically overwritten. 108 | .TP 109 | .BR \-D " " \fIopenAIPinputDir\fR 110 | It will convert all openAIP files in the specified directory. If used the options: -i, -w and -o are no longer valid. 111 | All airspace files (*_asp.aip) will be converted to OpenAir, while all waypoint files (*_wpt.aip and *_nav.aip) will be converted to SeeYou. 112 | .TP 113 | .BR \-p 114 | If writing to OpenAir with this option arcs (DA) and circles (DC) definitions are avoided. 115 | So the perimeter of each airspace will be defined using only points (DP). 116 | By default, without this option, arcs and circles are used even attepmting to recalculate them from points. 117 | .TP 118 | .BR \-s 119 | When writing to OpenAir this option will force coordinates expressed always in degrees minutes and seconds (DD:MM:SS). 120 | Coordinates expressed as DD:MM:SS (with seconds) are more compact and readable but less accurate since one second can be more than 30 meters. 121 | By default, without this option, the coordinates are automatically expressed in the most compact or accurate format every time: 122 | with seconds when the coordinate matches a specific second value (whitin 1/20 of second, 1.64 m) or in decimal minutes in the other cases to remain accurate. 123 | .TP 124 | .BR \-d 125 | When writing to OpenAir this option will force coordinates expressed always in degrees and decimal minutes (DD:MM.MMM). 126 | Coordinates expressed as DD:MM.MMM (with decimal minutes) are usually more accurate but less compact and readable. 127 | Without this option, by default, as described above, the coordinates are automatically expressed in the most convenient format. 128 | .TP 129 | .BR \-t 130 | When reading from KML/KMZ this option will make also the "LineString" tracks to be imported as airspaces. 131 | In this case the tracks found will be closed and treated as unknown GND based airspace with ceiling at 1000 mt AGL. 132 | Without this option, KML "LineString" tracks are ingnored by default. 133 | This option is meant to import long lists of points (like state borders) so then the airspace definitions can be adapted manually in OpenAir files. 134 | .TP 135 | .BR \-v 136 | Print version number. 137 | .TP 138 | .BR \-h 139 | Print a short help guide. 140 | -------------------------------------------------------------------------------- /QtGUI/AboutDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AboutDialog 4 | 5 | 6 | true 7 | 8 | 9 | 10 | 0 11 | 0 12 | 380 13 | 230 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 21 | 22 | 23 | 24 | 380 25 | 230 26 | 27 | 28 | 29 | 30 | 380 31 | 230 32 | 33 | 34 | 35 | Qt::NoContextMenu 36 | 37 | 38 | About AirspaceConverter 39 | 40 | 41 | 42 | :/icons/airspaceconverter128.xpm:/icons/airspaceconverter128.xpm 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 270 51 | 180 52 | 95 53 | 31 54 | 55 | 56 | 57 | &OK 58 | 59 | 60 | 61 | 62 | 63 | 110 64 | 10 65 | 251 66 | 16 67 | 68 | 69 | 70 | 71 | 75 72 | true 73 | 74 | 75 | 76 | AirspaceConverter 77 | 78 | 79 | 80 | 81 | 82 | 110 83 | 30 84 | 61 85 | 16 86 | 87 | 88 | 89 | Version: 90 | 91 | 92 | 93 | 94 | 95 | 110 96 | 70 97 | 221 98 | 21 99 | 100 | 101 | 102 | Copyright (C) 2016 103 | 104 | 105 | 106 | 107 | 108 | 20 109 | 130 110 | 291 111 | 16 112 | 113 | 114 | 115 | <html><head/><body><p>AirspaceConverter author</p></body></html> 116 | 117 | 118 | Written by: Alberto Realis-Luc 119 | 120 | 121 | 122 | 123 | 124 | 180 125 | 30 126 | 181 127 | 16 128 | 129 | 130 | 131 | <html><head/><body><p>This is the version of the current installed AirspaceConverter.</p><p>Check the website for newer versions.</p></body></html> 132 | 133 | 134 | <html><head/><body><p><br/></p></body></html> 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 20 144 | 180 145 | 241 146 | 16 147 | 148 | 149 | 150 | <html><head/><body><p>For more info click this link to visit AirspaceConverter website.</p></body></html> 151 | 152 | 153 | <a href="https://www.alus.it/AirspaceConverter/">www.alus.it/AirspaceConverter</a> 154 | 155 | 156 | Qt::RichText 157 | 158 | 159 | true 160 | 161 | 162 | Qt::TextBrowserInteraction 163 | 164 | 165 | 166 | 167 | 168 | 20 169 | 200 170 | 241 171 | 16 172 | 173 | 174 | 175 | <html><head/><body><p>For any comment about AirspaceConverter write to this e-mail.</p></body></html> 176 | 177 | 178 | <a href="mailto:info@alus.it">info@alus.it</a> 179 | 180 | 181 | Qt::RichText 182 | 183 | 184 | true 185 | 186 | 187 | Qt::TextBrowserInteraction 188 | 189 | 190 | 191 | 192 | 193 | 20 194 | 20 195 | 64 196 | 64 197 | 198 | 199 | 200 | <html><head/><body><p><br/></p></body></html> 201 | 202 | 203 | 204 | 205 | 206 | :/icons/airspaceconverter128.xpm 207 | 208 | 209 | true 210 | 211 | 212 | 213 | 214 | 215 | 110 216 | 50 217 | 261 218 | 16 219 | 220 | 221 | 222 | <html><head/><body><p>This is exactly when the current version was compiled.</p></body></html> 223 | 224 | 225 | <html><head/><body><p><br/></p></body></html> 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 110 235 | 150 236 | 181 237 | 20 238 | 239 | 240 | 241 | <html><head/><body><p>AirspaceConverter author</p></body></html> 242 | 243 | 244 | Valerio Messina 245 | 246 | 247 | 248 | 249 | 250 | 20 251 | 100 252 | 341 253 | 21 254 | 255 | 256 | 257 | 258 | 259 | 260 | <html><head/><body><p><br/></p></body></html> 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | OKpushButton 273 | clicked() 274 | AboutDialog 275 | close() 276 | 277 | 278 | 207 279 | 205 280 | 281 | 282 | 199 283 | 149 284 | 285 | 286 | 287 | 288 | 289 | -------------------------------------------------------------------------------- /Windows/AirspaceConverterLib/AirspaceConverterLib.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | 14 | {1412BB18-5649-411D-B0A2-0A32E6402939} 15 | Win32Proj 16 | AirspaceConverterLib 17 | 10.0 18 | 19 | 20 | 21 | StaticLibrary 22 | true 23 | v142 24 | Unicode 25 | 26 | 27 | StaticLibrary 28 | false 29 | v142 30 | true 31 | Unicode 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | true 47 | C:\local\boost_1_89_0;$(VC_IncludePath);$(WindowsSDK_IncludePath); 48 | C:\local\boost_1_89_0\lib64-msvc-14.2;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 49 | $(SolutionDir)$(Configuration)\$(Platform)\ 50 | $(Configuration)\$(Platform)\ 51 | .lib 52 | true 53 | 54 | 55 | false 56 | C:\local\boost_1_89_0;$(VC_IncludePath);$(WindowsSDK_IncludePath); 57 | C:\local\boost_1_89_0\lib64-msvc-14.2;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 58 | $(SolutionDir)$(Configuration)\$(Platform)\ 59 | $(Configuration)\$(Platform)\ 60 | .lib 61 | true 62 | 63 | 64 | 65 | 66 | 67 | Level4 68 | Disabled 69 | _WINDOWS;_USRDLL;AIRSPACECONVERTERLIB_EXPORTS;_WIN32_WINNT=0x0601;_DEBUG;%(PreprocessorDefinitions) 70 | true 71 | false 72 | false 73 | stdcpp20 74 | 75 | 76 | Windows 77 | true 78 | 79 | 80 | 81 | 82 | Level4 83 | 84 | 85 | MaxSpeed 86 | true 87 | true 88 | _WINDOWS;_USRDLL;AIRSPACECONVERTERLIB_EXPORTS;_WIN32_WINNT=0x0601;NDEBUG;%(PreprocessorDefinitions) 89 | true 90 | false 91 | true 92 | stdcpp20 93 | 94 | 95 | Windows 96 | true 97 | true 98 | true 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 144 | 145 | 146 | 147 | 148 | 149 | 150 | --------------------------------------------------------------------------------