GlobalGrids.jl

1 Intro to GlobalGrids.jl

Discrete global grids (DGGs) for Julia.

GlobalGrids provides:

  • An idiomatic Julia interface to Uber’s H3 hexagonal grid system.
  • Icosahedron mesh and orientation utilities for DGG design (a work in progress).
  • Makie.jl and Rasters.jl integration.

A great resource for learning about DGGs is https://discreteglobalgrids.org

1.1 Installation

using Pkg
Pkg.add(url = "https://github.com/RallypointOne/GlobalGrids.jl")

1.2 Quickstart

import GlobalGrids as GG
using CairoMakie

# Create a lon/lat point
p = GG.LonLat(-75.0, 54.0)

# Find the cell containing the point at a given resolution
c = GG.H3Cell(p, 7)
Precompiling packages...
    872.7 msQuartoNotebookWorkerTablesExt (serial)
  1 dependency successfully precompiled in 1 seconds
Precompiling packages...
   2063.0 msQuartoNotebookWorkerLaTeXStringsExt (serial)
  1 dependency successfully precompiled in 2 seconds
Precompiling packages...
   1072.9 msQuartoNotebookWorkerJSONExt (serial)
  1 dependency successfully precompiled in 1 seconds
Precompiling packages...
   6234.4 msQuartoNotebookWorkerMakieExt (serial)
  1 dependency successfully precompiled in 6 seconds
Precompiling packages...
   5159.2 msQuartoNotebookWorkerCairoMakieExt (serial)
  1 dependency successfully precompiled in 5 seconds
 H3Cell 7 7-1203346
poly(GG.grid_ring(c, 1), color=1:6)