Skip to content

DGGS gallery ​

Compare the cell shapes and global arrangement of the six systems below. Each panel uses a level that keeps individual cells visible. To compare resolutions numerically, use cell size in metres. See Choosing a grid for the decision table and identifier limits.

The package also exports CopernicusDEMSystem(30) and (90). This specialized raster lattice has tiles at level 0 and pixels at level 1, with pixel widths that vary by latitude. It is not included in systems() or the six panels below.

julia
import DiscreteGlobalGrids as DGG
using GeoMakie
using WGLMakie
using DiscreteGlobalGridsVisualization

WGLMakie.activate!()

panels = [
    DGG.IGeo7System() => 2, DGG.H3System() => 1, DGG.HEALPixSystem() => 3,
    DGG.A5System() => 3, DGG.S2System() => 3, DGG.ISEA4RSystem() => 3,
]

figure = Figure(size = (1200, 850), figure_padding = 4)
for (k, (sys, level)) in enumerate(panels)
    row, col = fldmod1(k, 3)
    axis = GlobeAxis(
        figure[row, col];
        source = "+proj=longlat +R=1",
        dest = GeoMakie.Geodesy.Ellipsoid(; a = "1", b = "1"),
        camera_altitude = 2.0,
    )
    meshimage!(axis, -180 .. 180, -90 .. 90, fill("#f0faea", 1, 1);
        zlevel = -0.05, npoints = 300)
    dggpoly!(axis, DGG.levelgrid(sys, level);
        color = "#dcf5d7", strokecolor = "#2c7a1e", strokewidth = 0.9)
    lines!(axis, GeoMakie.coastlines(); color = ("#212529", 0.7), linewidth = 0.8,
        zlevel = 0.002)
    Label(figure[row, col, Top()], "$(nameof(typeof(sys))), level $level"; font = :bold)
end
figure

What differs ​

Each system refines its base cells differently, so equal level numbers can have very different cell counts and sizes:

julia
println(rpad("system", 10), lpad("levels", 8), lpad("cells at level 3", 18),
        "   id type")
for (sys, _) in panels
    println(rpad(chopsuffix(String(nameof(typeof(sys))), "System"), 10),
            lpad(string(DGG.levels(sys)), 8),
            lpad(DGG.ncells(DGG.levelgrid(sys, 3)), 18),
            "   ", nameof(DGG.cellindextype(sys)))
end
system      levels  cells at level 3   id type
IGeo7         0:19              3432   Z7Cell
H3            0:15             41162   H3Cell
HEALPix       0:29               768   LevelIndex
A5            0:29               960   A5Cell
S2            0:30               384   LevelIndex
ISEA4R        0:29               640   LevelIndex
  • IGeo7 — hexagons with twelve smaller pentagons; approximately equal areas and aperture-7 refinement.

  • H3 — the same hexagon family on gnomonic icosahedral faces, so not equal-area.

  • HEALPix — curvilinear diamonds, exactly 4π/(12·4^l) steradians each.

  • A5 — Cairo-style pentagons, equal-area on its ellipsoid; unit-sphere cell areas vary by about 1%.

  • S2 — geodesic quadrilaterals on the cube, about a 2× area spread within a level.

  • ISEA4R — rhombi on ten icosahedral diamonds, exactly 4π/(10·4^l) steradians each.

AuthalicSystem adapts a system's spherical geometry to geodetic latitude while preserving cell ids and hierarchy. A5 already returns geodetic geometry and rejects this wrapper.

Choosing a grid connects these differences to neighbourhood calculations, spatial averages, resolution and coordinate alignment.