MDAL

MDAL Logo

The Mesh Data Abstraction Library (MDAL) out of OSGeo is a “translator library” for many common conventions found in meteorology and hydrology. The library supports data found in Grib and NetCDF encoded as NetCDF Climate and Forecast Metadata Conventions (CF) or Unstructured Grid Conventions (CF/UGRID) and represented as geospatial mesh data. In addition to supporting mature and well-defined spatial data encodings in self-describing files, the library also supports numerous model-specific formats including Telemac, HEC-RAS, and TUFLOW.

The Open Source Geospatial Foundation is pleased to welcome the Mesh Data Abstraction Library (MDAL) to our Community program. MDAL is a translator library for more than 15 unstructured mesh geospatial formats used mainly in meteorology and hydrology.

The OSGeo Community program recognizes applications and tools that are geospatial, freely available with an open-source license, and are set up to collaborate fairly. This program helps OSGeo promote innovation and the hard work of teams and organizations worldwide. β€œIt’s great to see MDAL as a community project as it fulfills a vital function in opening up the use of mesh frameworks in popular open-source GIS packages such as QGIS, says Jo Cook, OSGeo Incubation Committee.

The MDAL projects addresses lowering the barrier to meteorological and hydrological data using geospatial toolkits. The driver provides low-level I/O to access unstructured mesh data for the purpose of visualization, processing, and editing. MDAL is under active development and is sponsored by industry-lead organizations.

The project source code is hosted on GitHub. Documentation and information about supported data formats can be found at the MDAL website.

About the MDAL project

In addition to vectors and regular gridded data in GIS, the real world can be modeled using unstructured mesh. In addition to the complex data structure, the mesh can also contain vectoral (e.g. wind speed) and temporal data. The common conventions to store such datasets are Hierarchical Data Format (HDF), Network Common Data Form (NetCDF), GRIdded Binary (GRIB), or ASCII formats. There are already tools to convert the formats to common raster or vector datasets. But with MDAL, software applications can natively read the data.

An example of integration of MDAL with other OSGeo projects can be found in QGIS: mesh layer provides the input/output data through the MDAL driver and QGIS is being used to render and process the data.

This library is positioned similarly to GDAL/OGR which is a core component of most open-source geospatial raster and vector data tools and libraries, with bindings to C, C++, C#, Python, and Perl. GDAL is used for reading, writing, data conversions, and transformations and includes command line utilities that can be used in BASH or other shells.

MDAL complements the existing GDAL toolset by providing input/output support for unstructured and gridded data specified in mesh topologies. The website specifies compatibility with a bunch of model-specific input/output formats as well as the commonly found community-based CF and UGRID standards typically used in the binary self-describing NetCDF format. Even the industry standard hydrodynamic storm surge model ADCIRC NetCDF output is supported because, while not mentioned specifically, it follows the CF-UGRID convention specifications.

MDAL in QGIS #

Most of the data I deal with in my work is either Grib or NetCDF, with NetCDF used for 2D-mesh-plaid grids, regular rectangular grids, and unstructured meshes adhering to the CF-UGRID conventions. With the open-source QGIS geospatial analysis and mapping software built from several OSGeo components including GDAL and MDAL, recent versions of QGIS have support for any of these mesh formats that are supported by MDAL including those data with time-varying data.

It has always been so much of a chore to just quickly open Grib or NetCDF data in QGIS that many toolsets and intermediaries have been developed by users over the years. I’m responsible for several scripts and libraries to quickly convert gridded and unstructured NetCDF data to point features or rasters so that I could work with them in GIS software, make map plots to examine data for QC purposes, or convert between similar formats. Without any extra effort these various metocean model data are now easily imported by QGIS.

Examples #

Grib ERA5 Inputs to WRF Mesoscale Atmospheric Model for the Canary Islands in QGIS
Grib ERA5 Inputs to WRF Mesoscale Atmospheric Model for the Canary Islands in QGIS

Steve Francia

ounf formatted Wavewatch3 Wave Model NetCDF Output in QGIS

ounf formatted Wavewatch3 Wave Model NetCDF Output in QGIS

Regular Grid (RGRID) OWI Unipost NetCDF in the North-Eastern Pacific Basin in QGIS

Regular Grid (RGRID) OWI Unipost NetCDF in the North-Eastern Pacific Basin in QGIS

‘Unstructured’ triangular mesh following CF-UGRID from ADCIRC Hydrodynamic Model in the Med. Sea including additional node/element conectivity rendered by QGIS

‘Unstructured’ triangular mesh following CF-UGRID from ADCIRC Hydrodynamic Model in the Med. Sea including additional node/element conectivity rendered by QGIS

Including to Python bindings for the MDAL lib.

MDAL Website https://www.mdal.xyz/
MDAL OSGeo Page https://www.osgeo.org/projects/mdal/
OSGeo News Brief https://www.osgeo.org/foundation-news/
MDAL Python Bindings https://www.mdal.xyz/api/python_api.html#python-api
Source Code Repository https://github.com/lutraconsulting/MDAL
GDAL Website https://gdal.org/
QGIS Website https://www.qgis.org/en/site/
QGIS on Flathub https://flathub.org/apps/details/org.qgis.qgis