Decodes and re-encodes a Z7 index until it reaches a stable form. Every valid index is already canonical and comes back unchanged. A string whose first nonzero digit is the direction its pentagon base cell lacks names no cell; it decodes, as in DGGRID, to the lattice point its digits reach, and this function returns the index of the cell there.
Examples
# Valid Z7 indices are stable
hexify_z7_canonical("110001")
cell <- hexify_index_to_cell("110001", aperture = 7)
identical(
hexify_cell_to_index(cell$face, cell$i, cell$j,
cell$resolution, aperture = 7
),
"110001"
)