lutraconsulting / MDAL

Mesh Data Abstraction Library
http://www.mdal.xyz/
MIT License
158 stars 49 forks source link
gis mesh

Linux Tests MemCheck Tests Coverage Tests OSX Tests WIN Tests

Code Style Coverage Status Docs Build Anaconda-Server Badge

MDAL

Mesh Data Abstraction Library

MDAL is an OSGeo Community Project

MDAL OSGeo

Mailing List

To discuss development and usage, please use mdal-developer@lists.osgeo.org

Supported Formats

You can use MDAL to load the following file formats:

* Data lazy loaded

** Formats can be preprocessed using QGIS Crayfish Mesh processing algorithm to one of supported formats

*** Results should pre pre-processed to become UGRID compliant

Format Mesh Frame Support Mesh Lazy Loaded 1D Data Support 2D Data Support 3D Data Support Data Lazy Loaded
2DM READ-WRITE N/A N/A N/A N/A N/A
XMS TIN READ-ONLY N/A N/A N/A N/A N/A
Esri TIN READ-ONLY N/A N/A N/A N/A N/A
GDAL-NetCDF READ-ONLY NO NO READ-ONLY N/A NO
GDAL-GRIB READ-ONLY NO NO READ-ONLY N/A NO
XMDF N/A N/A NO READ-ONLY READ-ONLY YES
XDMF N/A N/A NO READ-ONLY NO YES
DAT N/A N/A READ-ONLY READ-WRITE N/A NO
3Di READ-ONLY NO READ-ONLY READ-ONLY NO NO
UGRID READ-WRITE NO READ-ONLY READ-WRITE NO NO
FLO-2D READ-ONLY NO READ-ONLY READ-WRITE NO NO
Selafin READ-WRITE NO NO READ-WRITE NO NO
SWW READ-ONLY NO NO READ-ONLY NO NO
PLY READ-WRITE N/A READ-WRITE READ-WRITE READ-WRITE N/A
DFSU READ-ONLY N/A NO READ-ONLY READ-ONLY YES
DFS2 READ-ONLY N/A NO READ-ONLY N/A YES
H2i READ-ONLY NO NO READ-ONLY N/A YES
Mike21 READ-WRITE N/A N/A N/A N/A N/A

Standalone Installation

MDAL can be installed as a stand-alone package (i.e. outside of QGIS) using conda.

The package can installed by running :

conda install -c conda-forge mdal

This package provides the MDAL ABI through the mdal shared object( i.e. mdal.dll, libmdal.dylib or libmdal.so) and the mdalinfo CLI.

A friendly note about versions. The conda package is usually targetted at the latest version of GDAL on conda-forge. This is usually a later version than used by QGIS. Therefore, there may be some subtle differences in behaviour when loading e.g. GRIB files.

Versioning and integration in QGIS

QGIS contains internal copy of MDAL library in following versions:

QGIS MDAL Features
3.0.2 N/A 2D meshes
3.2.3 0.0.3
3.4.14 0.0.10
3.6.3 0.3.2 Many new formats supported
3.8.3 0.3.3
3.10.0 0.3.3
3.10.1 0.4.0 Save datasets for some formats
3.10.2 0.4.1
3.10.3 0.4.2
3.12.0 0.5.1 3D layered meshes
3.14.0 0.6.1 1D meshes
3.16.0 0.7.1 Mesh creation, PLY format
3.18.0 0.8.0 Dynamic drivers, DFSU format
3.20.0 0.8.1
3.22.0 0.9.x DFS2, DFSU 3D, PLY write
3.24.0 1.0.x TBD
3.24.1 0.9.90 H2i format
3.28.0 1.0.0 write dataset capability for UGRID format
3.28.2 1.0.1
3.28.4 1.0.2
3.30.0 1.0.2
3.36.0 1.1.0 Mike21 format support read/write
3.38.0 1.2.0 Groundwater / surface water meshes for 3Di format

versions X.Y.9Z are development versions or alpha/beta releases (e.g. 0.4.90, 0.4.91, ...)

Backporting

We maintain the version of MDAL used in current QGIS LTR version. For any CRITICAL bugfixes (e.g. crashes, coredumps, regressions, data corruption) we want to backport the code to MDAL LTR version. To do this, label your pull request with label "backport release-XXX". Once pull request is merged, mdal-bot will automatically create a pull request to specified branch. Note that the pull request must be squashed to 1 commit for automatic backport.

Development

Coding standards & Contribution

MDAL is an open-source project and all contributions to either documentation, format support, testing or code are more than appreciated. Any change to the code must go through Pull Request, followed by review by one of the MDAL core developers.

To be able to accept a pull request, please verify that:

Please respect our Contributor Covenant Code of Conduct

Build

Windows

For 64-bit version:

Linux

install dependencies for drivers

sudo apt-get install libgdal-dev libhdf5-dev libnetcdf-dev libxml2-dev

and use cmake to generate build system

mkdir build;cd build
cmake -DCMAKE_BUILD_TYPE=Rel -DENABLE_TESTS=ON ..
make

MacOS

First you need to install qgis-deps dependencies,

To build, create build system with cmake and make sure you use dependencies from qgis-deps and not system ones

mkdir build;cd build
cmake -DCMAKE_PREFIX_PATH=/opt/QGIS/qgis-deps-0.5.3/stage -DCMAKE_BUILD_TYPE=Debug -GNinja -DENABLE_TESTS=ON ../
ninja

External Drivers

see DFSU

Tests

run ctest command in build directory ctest -VV

Code syntax

format code:

cd scripts
./check_all.bash

or use git pre-commit hook

cd MDAL
ln -s ./scripts/mdal_astyle.bash .git/hooks/pre-commit

Windows

On Windows, the code can be formatted using the following :

cd MDAL
powershell -ExecutionPolicy BYPASS scripts\check_all.ps1