Builds graphs from Uber H3 hexagonal grids.
Requires the optional :h3 dependency.
Topologies
:rook— the 6 edge-adjacent neighbors (default):queen— rook + 6 vertex-adjacent neighbors (12 total)
Examples
iex> graph =
...> Meridian.Graph.new(kind: :undirected)
...> |> Meridian.Builder.H3.grid(center: {40.7484, -73.9857}, resolution: 9, k_ring: 1)
iex> Meridian.Graph.node_count(graph)
7
Summary
Functions
Creates a graph from an H3 hexagonal grid centered on a lat/lon point.
Functions
@spec grid( Meridian.Graph.t(), keyword() ) :: Meridian.Graph.t()
Creates a graph from an H3 hexagonal grid centered on a lat/lon point.
Options
:center—{lat, lon}tuple (required):resolution— H3 resolution, 0–15 (required):k_ring— number of rings outward from center, default1:topology—:rook(default) or:queen:node_data_fn— function(h3_index :: integer) -> mapto populate node data
Examples
iex> graph =
...> Meridian.Graph.new(kind: :undirected)
...> |> Meridian.Builder.H3.grid(center: {37.7749, -122.4194}, resolution: 5, k_ring: 1)
iex> Meridian.Graph.node_count(graph) >= 1
true