Home

Awesome

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

FormatMesh Frame SupportMesh Lazy Loaded1D Data Support2D Data Support3D Data SupportData Lazy Loaded
2DMREAD-WRITEN/AN/AN/AN/AN/A
XMS TINREAD-ONLYN/AN/AN/AN/AN/A
Esri TINREAD-ONLYN/AN/AN/AN/AN/A
GDAL-NetCDFREAD-ONLYNONOREAD-ONLYN/ANO
GDAL-GRIBREAD-ONLYNONOREAD-ONLYN/ANO
XMDFN/AN/ANOREAD-ONLYREAD-ONLYYES
XDMFN/AN/ANOREAD-ONLYNOYES
DATN/AN/AREAD-ONLYREAD-WRITEN/ANO
3DiREAD-ONLYNOREAD-ONLYREAD-ONLYNONO
UGRIDREAD-WRITENOREAD-ONLYREAD-WRITENONO
FLO-2DREAD-ONLYNOREAD-ONLYREAD-WRITENONO
SelafinREAD-WRITENONOREAD-WRITENONO
SWWREAD-ONLYNONOREAD-ONLYNONO
PLYREAD-WRITEN/AREAD-WRITEREAD-WRITEREAD-WRITEN/A
DFSUREAD-ONLYN/ANOREAD-ONLYREAD-ONLYYES
DFS2READ-ONLYN/ANOREAD-ONLYN/AYES
H2iREAD-ONLYNONOREAD-ONLYN/AYES
Mike21READ-WRITEN/AN/AN/AN/AN/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:

QGISMDALFeatures
3.0.2N/A2D meshes
3.2.30.0.3
3.4.140.0.10
3.6.30.3.2Many new formats supported
3.8.30.3.3
3.10.00.3.3
3.10.10.4.0Save datasets for some formats
3.10.20.4.1
3.10.30.4.2
3.12.00.5.13D layered meshes
3.14.00.6.11D meshes
3.16.00.7.1Mesh creation, PLY format
3.18.00.8.0Dynamic drivers, DFSU format
3.20.00.8.1
3.22.00.9.xDFS2, DFSU 3D, PLY write
3.24.01.0.xTBD
3.24.10.9.90H2i format
3.28.01.0.0write dataset capability for UGRID format
3.28.21.0.1
3.28.41.0.2
3.30.01.0.2
3.36.01.1.0Mike21 format support read/write
3.38.01.2.0Groundwater / surface water meshes for 3Di format
3.42.01.3.0Fix 2dm format coordinates saving
XMDF loading Dataset Group fix, support for Mesh in XMDF files (as 2DMeshModule)
Support Dataset Group Removal From Mesh

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:

cmake -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Rel  ^
    -DENABLE_TESTS=ON ^
    -DNETCDF_PREFIX="C:\OSGeo4W64" ^
    -DHDF5_ROOT="C:\OSGeo4W64" ^
    -DGDAL_DIR="C:\OSGeo4W64" ^
    -DGDAL_LIBRARY="C:\OSGeo4W64\lib\gdal_i.lib" ^
    -DGDAL_INCLUDE_DIR="C:\OSGeo4W64\include" ^
    -DLIBXML2_LIBRARIES="C:\OSGeo4W64\lib\libxml2.lib ^
    -DLIBXML2_INCLUDE_DIR="C:\OSGeo4W64\include\libxml2" ^
    -D EXTERNAL_DRIVER_DHI_DFS=OFF ^
    ..

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