Introduction to the Discrete Global Grid Abstraction Library (DGGAL)
11-21, 09:30–09:55 (Pacific/Auckland), WA220

An introduction and overview of the capabilities provided by the Free and Open Source Software Discrete Global Grid Abstraction Library (DGGAL) https://dggal.org https://github.com/ecere/dggal


DGGAL provides a common interface to perform various operations on Discrete Global Grid Reference Systems (DGGRS), facilitating the implementation of Discrete Global Grid Systems (DGGS),
including implementing Web APIs based on the OGC API - DGGS Standard.

DGGAL, including the dgg command-line utility as well as the Python bindings to the library, can be installed from from PyPI with pip install dggal.

DGGAL currently supports all three DGGRS described in OGC API - DGGS Annex B, as well as additional DGGRSs:

  • GNOSIS Global Grid: An axis-aligned quad-tree defined in WGS84 latitude and longitude, with special handling of polar regions, corresponding to the OGC 2D Tile Matrix Set of the same name
  • ISEA3H: An equal area hexagonal grid with a refinement ratio of 3 defined in the Icosahedral Snyder Equal Area (ISEA) projection
  • ISEA9R: An equal area rhombic grid with a refinement ratio of 9 defined in the ISEA projection transformed into a 5x6 Cartesian space resulting in axis-aligned square zones
  • IVEA3H: An equal area hexagonal grid with a refinement ratio of 3 defined in the Icosahedral Vertex-oriented Great Circle Equal Area (tentatively called IVEA) projection based on Slice & Dice (2006), using the same global indexing and sub-zone ordering as for ISEA3H
  • IVEA9R: An equal area rhombic grid with a refinement ratio of 9 defined in the IVEA projection transformed into a 5x6 Cartesian space resulting in axis-aligned square zones, using the same global indexing and sub-zone ordering as for ISEA9R
  • RTEA3H: An equal area hexagonal grid with a refinement ratio of 3 defined in the Rhombic Triacontahedron Equal Area (RTEA) projection, a configuration of the Slice & Dice great circle projection equivalent to applying Snyder's projection to the RT, using the same global indexing and sub-zone ordering as for ISEA3H
  • RTEA9R: An equal area rhombic grid with a refinement ratio of 9 defined in the RTEA projection transformed into a 5x6 Cartesian space resulting in axis-aligned square zones, using the same global indexing and sub-zone ordering as for ISEA9R
  • rHEALPix: An equal area and axis-aligned grid with square zones topology and a refinement ratio of 9 defined in the rHEALPix projection (using same parameters as default PROJ implementation) with the original hierarchical indexing and scanline-based sub-zone ordering

The API documentation can be found here.

The DGGRS class provides most of the functionality of the library, allowing to resolve DGGRS zones by textual ID to a unique 64-bit zone integer identifier (DGGRSZone).
The geometry and sub-zones of a particular zone can also be queried.
The concept of sub-zones is key to encoding both vector and raster geospatial data quantized to a DGGRS.
The DGGAL library also allows to resolve a sub-zone index at a particular depth from a parent zone, allowing to read DGGS-optimized data such as DGGS-JSON and DGGS-JSON-FG.

The recommended method to obtain and build DGGAL and the dgg tool is to follow the instructions in BUILDING.md, or running fetchAndBuild.sh / fetchAndBuild.bat.

While the library is written in the eC programming language, object-oriented bindings for C, C++ and Python generated using the Ecere SDK's bgen tool are provided. Bindings for Rust are available as well. Support for additional languages may be added in the future.

Example usage of the bindings to the different programming languages can be found here.

The dgg tool provides the ability to perform various operations from the command-line, including generating grids at different refinement levels, querying information about a particular zone identifier, identifying the zone a particular set of geospatial coordinates, listing the zones within a certain bounding box, resolving sub-zone indices and converting compact DGGS-JSON data files to GeoJSON files.

Acknowledgement
Financial support provided by GeoConnections, a national collaborative initiative led by Natural Resources Canada. GeoConnections supports the modernization of the Canadian Geospatial Data Infrastructure (CGDI). The CGDI is the collection of geospatial data, standards, policies, applications, and governance that facilitate its access, use, integration, and preservation.

Jérôme St-Louis is founder and CTO of Ecere, initiated the FOSS Ecere Cross-Platform SDK project (1996), designed the eC programming language (2004) and the GNOSIS geospatial software suite (2014). Jérôme is now releasing a number of GNOSIS components as open-source projects, including DGGAL, libCartoSym, libCQL2 and libDE9IM. Jérôme is co-chair of multiple OGC Standard Working Groups and co-editors of multiple OGC Standards, as well as an OSGeo charter member and active contributor to the open-source geospatial community.

This speaker also appears in: