API Reference
Resolution Statistics
Precomputed data for IGEO7 grid resolutions (0–20).
Missing docstring for get_resolution_stats. Check Documenter's build log for details.
IGEO7.get_num_cells — Function
get_num_cells(resolution::Int)Get the total number of cells in the IGEO7 grid at a given resolution.
IGEO7.get_cell_area_m2 — Function
get_cell_area_m2(resolution::Int)Get the average cell area in square meters (m²) at a given resolution.
IGEO7.get_cell_area_km2 — Function
get_cell_area_km2(resolution::Int)Get the average cell area in square kilometers (km²) at a given resolution.
IGEO7.get_cls_m — Function
get_cls_m(resolution::Int)Get the characteristic length scale (CLS) in meters (m) at a given resolution.
IGEO7.get_cls_km — Function
get_cls_km(resolution::Int)Get the characteristic length scale (CLS) in kilometers (km) at a given resolution.
IGEO7.find_resolution_by_value — Function
find_resolution_by_value(target::Real, metric::Symbol; prefer::Symbol=:closest)Find the grid resolution (0-20) that best matches a target value for a specific metric. Metrics include :num_cells, :area_km2, :area_m2, :cls_km, and :cls_m. Strategy prefer can be :closest, :larger, or :smaller.
IGEO7.find_resolution_by_cls_m — Function
find_resolution_by_cls_m(target_m::Real; prefer::Symbol=:closest)Find the best resolution matching a target characteristic length scale in meters.
IGEO7.find_resolution_by_area_m2 — Function
find_resolution_by_area_m2(target_m2::Real; prefer::Symbol=:closest)Find the best resolution matching a target cell area in square meters.
IGEO7.find_resolution_by_num_cells — Function
find_resolution_by_num_cells(target_cells::Integer; prefer::Symbol=:closest)Find the best resolution matching a target number of cells.
Indexing and Types
The core data structures and conversion utilities for Z7 cell indices.
IGEO7.Z7IndexUInt64 — Type
Z7IndexUInt64(raw::UInt64)A Z7 cell index representation that stores only the raw UInt64 value. Digits are extracted on-the-fly using bit manipulation.
IGEO7.Z7IndexComp — Type
Z7IndexComp(raw::UInt64)A Z7 cell index representation that decodes and stores its digits in an SVector upon construction. Faster for multiple digit accesses at the cost of higher construction time and memory.
IGEO7.z7string_to_index — Function
Convert a Z7 string (e.g., "0800433") to Z7IndexUInt64.
IGEO7.index_to_z7string — Function
Convert a Z7IndexUInt64 to Z7 string representation.
Convert a Z7IndexComp to Z7 string representation.
Missing docstring for decode_z7hex_index. Check Documenter's build log for details.
Missing docstring for encode_z7hex_index. Check Documenter's build log for details.
IGEO7.get_resolution — Function
get_resolution(idx)Get the grid resolution level of the cell (0-20).
IGEO7.get_base_cell — Function
get_base_cell(idx)Get the base cell ID (0-11) of the given Z7 index.
IGEO7.get_digit — Function
get_digit(idx, i::Int)Get the digit at resolution i (1-indexed). Digits are 0-6, or 7 if beyond resolution.
IGEO7.get_digits — Function
get_digits(idx)Get all 20 resolution digits of the index as a tuple.
IGEO7.get_parent — Function
get_parent(idx, [resolution])Get the parent cell of the given index at the specified resolution (defaults to current resolution - 1).
get_parent(idx)Get the parent cell of the given index at the previous resolution.
Neighbor Traversal
Methods for finding adjacent cells and navigating the grid.
IGEO7.get_neighbours — Function
get_neighbours(ref)Find all 6 immediate neighbors (or 5 for pentagons) of a given cell index. Invalid neighbors for pentagonal base cells are marked with a bitmask of typemax(UInt64).
Compute all 6 neighbours of a Z7IndexComp cell at its resolution.
IGEO7.get_neighbour — Function
get_neighbour(ref, direction, resolution)Compute a single neighbor index in one of 6 directions (1-6) at the given resolution level. Returns a Z7Carry struct which tracks the new index and whether the cell crossed a base cell boundary.
Compute a single neighbour in direction N (1-6) at a given resolution for Z7IndexComp.
IGEO7.get_base_cell_neighbours — Function
Get the neighbouring base cells for a given base cell. Returns a vector of base cell IDs (0-11). Pentagons have only 5 neighbours.
IGEO7.get_base_cell_neighbour — Function
Get the neighbour base cell in a specific direction (0-4 for pentagons). Returns nothing if direction is invalid (≥5 for pentagons).
We could also instead of limiting at 5 use the now filled directions