Learn R Programming

hexify (version 0.3.8)

hexify_cell_to_index: Convert cell coordinates to index string

Description

Converts DGGRID cell coordinates (face, i, j) to a hierarchical index string. The index type is automatically selected based on aperture unless specified.

Usage

hexify_cell_to_index(
  face,
  i,
  j,
  resolution,
  aperture = 3L,
  index_type = c("auto", "z3", "z7", "zorder")
)

Value

Index string (e.g., "051223")

Arguments

face

Face/quad number (0-19)

i

I coordinate

j

J coordinate

resolution

Resolution level

aperture

Aperture (3, 4, or 7)

index_type

Index encoding: "auto" (default), "z3", "z7", or "zorder"

Details

Default index types by aperture:

  • Aperture 3: Z3 (optimized digit selection)

  • Aperture 4: Z-order (Morton curve)

  • Aperture 7: Z7 (hierarchical with Class III handling)

See Also

Other hierarchical index: hexify_compare_indices(), hexify_default_index_type(), hexify_get_children(), hexify_get_parent(), hexify_get_resolution(), hexify_index_to_cell(), hexify_index_to_lonlat(), hexify_is_valid_index_type(), hexify_lonlat_to_index(), hexify_z7_canonical()

Examples

Run this code
idx <- hexify_cell_to_index(5, 10, 15, resolution = 3, aperture = 3)

Run the code above in your browser using DataLab