Skip to contents

Generates a table comparing different resolution levels for a given grid configuration. Useful for choosing appropriate resolution.

Usage

hexify_compare_resolutions(
  aperture = 3,
  res_range = 0:15,
  type = c("isea", "h3"),
  print = FALSE,
  radius_km = EARTH_RADIUS_KM
)

Arguments

aperture

Grid aperture (3, 4, or 7). Ignored for H3 grids.

res_range

Range of resolutions to compare (e.g., 1:10)

type

Grid type: "isea" (default) or "h3".

print

If TRUE, prints a formatted table to console. If FALSE (default), returns a data frame.

radius_km

Radius of the body, in kilometers, or a body name such as "mars" (default Earth). See hex_grid.

Value

If print=FALSE: data frame with columns resolution, n_cells, cell_area_km2, cell_spacing_km, cls_km. If print=TRUE: invisibly returns the data frame after printing.

Examples

# Get data frame of resolutions 0-10 for aperture 3
comparison <- hexify_compare_resolutions(aperture = 3, res_range = 0:10)
print(comparison)

# Print formatted table directly
hexify_compare_resolutions(aperture = 3, res_range = 0:10, print = TRUE)

# Find resolution with cells ~1000 km^2
subset(comparison, cell_area_km2 > 900 & cell_area_km2 < 1100)

# Resolutions on another body
hexify_compare_resolutions(aperture = 3, res_range = 0:6, radius_km = "mars")