This repository contains the specification of BAG data format and the necessary library code and examples required to build and work with data in the BAG format:
- api - This is the primary API directory and contains the source for the Bathymetric Attributed Grid format (BAG).
- configdata - Required XML support files. You must have an environment variable called BAG_HOME mapped to this directory in order to run the API functions.
- docs - Miscellaneous and historical documentation resides here
- examples - Contains programs to demonstrate some of the API functionality. In particular bag_create and bag_read are good starting points.
- python - Contains Python units tests and examples that make use of the SWIG interface.
- tests - Contains C++ tests.
The BAG specification and library are produced by the Open Navigation Surface project.
Documentation for the BAG specification and library can be found here, in particular:
The BAG library, and its dependencies, can be installed in a Conda environment (for example, Anaconda or Miniconda).
If you only want the C++ library, install libbaglib.
To install the Python bindings (along with the C++ library) install bagpy.
Note: the
bagpy
package on PyPI is unrelated to the BAG library. Do not do runpip install bagpy
install, only install via conda using the link above.
Once installed, you can test C++ library by building the BAG examples as a standalone project.
Note: You can use FindBAG.cmake in your own projects to locate libbaglib installed via conda.
Likewise, you can run the Python tests using the Conda-provided bagpy
bindings by first installing the test dependencies into your conda environment:
pip install -r requirements.txt
Then run the tests (Linux and macOS):
BAG_SAMPLES_PATH=./examples/sample-data python -m pytest python/test_*.py
Under Windows, run:
set BAG_SAMPLES_PATH=examples\sample-data
python -m pytest python\test_*.py
Comprehensive build instructions can be found here.
For a Quick Start using make
to build C++ applications on Linux, see QUICKSTART.MD.