Skip to contents

Grid-based wrapper for hexify_lonlat_to_cell. Converts geographic coordinates to DGGRID-compatible cell IDs using the resolution and aperture from a grid object.

Usage

hexify_grid_to_cell(grid, lon, lat)

Arguments

grid

Grid specification from hexify_grid()

lon

Numeric vector of longitudes in degrees

lat

Numeric vector of latitudes in degrees

Value

Numeric vector of cell IDs (1-based)

Examples

if (FALSE) { # \dontrun{
grid <- hexify_grid(area = 1000, aperture = 3)
cell_ids <- hexify_grid_to_cell(grid, lon = c(0, 10), lat = c(45, 50))
} # }