% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hexify_index.R
\name{hexify_cell_to_index}
\alias{hexify_cell_to_index}
\title{Convert cell coordinates to index string}
\usage{
hexify_cell_to_index(
  face,
  i,
  j,
  resolution,
  aperture = 3L,
  index_type = c("auto", "z3", "z7", "zorder")
)
}
\arguments{
\item{face}{Face/quad number (0-19)}

\item{i}{I coordinate}

\item{j}{J coordinate}

\item{resolution}{Resolution level}

\item{aperture}{Aperture (3, 4, or 7)}

\item{index_type}{Index encoding: "auto" (default), "z3", "z7", or "zorder"}
}
\value{
A character vector of index strings.
}
\description{
Converts cell coordinates (\code{face}, \code{i}, \code{j}) to a hierarchical index string.
The index type is selected from \code{aperture} when \code{index_type = "auto"}.
}
\details{
Default index types by aperture:
\itemize{
\item Aperture 3: Z3 (optimized digit selection)
\item Aperture 4: Z-order (Morton curve)
\item Aperture 7: Z7 (one base-7 child digit per resolution)
}

A Z7 index has the form \code{BBd1...dr}, where \code{BB} is the two-digit base
cell (00--11), \code{r} is the resolution, and every child digit is in 0--6.
hexify's Z7 encoding is bijective: decoding and re-encoding a valid index
returns the same string. It follows DGGRID's Z7 layout for ordinary cells,
but retains distinct indices in pentagon regions where DGGRID's encoder can
map different cells to the same string.
}
\examples{
idx <- hexify_cell_to_index(5, 10, 15, resolution = 3, aperture = 3)

# Aperture-7 indices contain a two-digit base cell and one digit per level
z7 <- hexify_cell_to_index(5, 1, 1, resolution = 2, aperture = 7)
nchar(z7) == 4L
}
\seealso{
Other hierarchical index:
\code{\link[=hexify_compare_indices]{hexify_compare_indices()}},
\code{\link[=hexify_default_index_type]{hexify_default_index_type()}},
\code{\link[=hexify_get_children]{hexify_get_children()}},
\code{\link[=hexify_get_parent]{hexify_get_parent()}},
\code{\link[=hexify_get_resolution]{hexify_get_resolution()}},
\code{\link[=hexify_index_to_cell]{hexify_index_to_cell()}},
\code{\link[=hexify_index_to_lonlat]{hexify_index_to_lonlat()}},
\code{\link[=hexify_is_valid_index_type]{hexify_is_valid_index_type()}},
\code{\link[=hexify_lonlat_to_index]{hexify_lonlat_to_index()}},
\code{\link[=hexify_z7_canonical]{hexify_z7_canonical()}}
}
\concept{hierarchical index}
\keyword{internal}
