Units for air navigation as defined in International Civil Aviation Organization (ICAO) Annex 5.
The library defines:
- the SI units used in the International Standard Atmosphere (ISA),
- the non-SI units defined in
ICAO Annex 5Table 3-3, - and conversions between SI and non-SI units.
The C++ software has no dependencies. The C++ tests use the boost.test library.
The library is header only, so the library include directory just needs to be added to the include path.
Alternatively, when using cmake the environment variable ViaUnits_DIR just needs
to be set to the location of the via-units-cpp directory; cmake will add it to the include path.
Note: CMakeLists.txt is setup to install python by default, so -DINSTALL_PYTHON=OFF
must be passed to cmake when building for C++.
cmake can also be used to install the library to the relevant include directory on Linux/macOS.
In the via-units-cpp directory, run:
cmake -DINSTALL_PYTHON=OFF .
sudo make installNote: it will be necessary to delete the CMakeCache.txt file created by
running cmake above, before running cmake on this library again.
The C++ tests can be built and run using cmake by running:
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DINSTALL_PYTHON=OFF -DCPP_UNIT_TESTS=ON <via-units-cpp directory>
make
make testNote: -DCMAKE_EXPORT_COMPILE_COMMANDS=1 creates a compile_commands.json
file which can be copied back into the via-units-cpp directory for
clangd tools.
The library uses pybind11 to provide C++ Python bindings and scikit-build to build a python package using cmake.
From the parent directory of via-units-cpp, run:
pip install ./via-units-cppIn Python code import the software as via_units, e.g.:
from via_units import Feet, Metres, NauticalMilesSee: test_units.py.
via-units-cpp is provided under a MIT license, see LICENSE.