Skip to contents

Finds the grid resolution that produces cells closest to the target area. This is primarily used internally by hexify_grid and hex_grid. Most users should use those functions directly.

Usage

dg_closest_res_to_area(
  dggs,
  area,
  round = "nearest",
  metric = TRUE,
  show_info = FALSE
)

Arguments

dggs

Grid specification (aperture and topology must be set)

area

Target cell area in km^2 (if metric=TRUE)

round

Rounding method ("nearest", "up", "down")

metric

Whether area is in metric units

show_info

Print information about chosen resolution

Value

Resolution level (integer)

Examples

grid <- hex_grid(resolution = 5, aperture = 3)
dg_closest_res_to_area(grid, area = 1000, show_info = TRUE)