Skip to contents

cell_sample() is the fast, geometry-free raster path. Cell centers are transformed into the raster coordinate reference system and sampled with terra::extract(). Use cell_extract() when partial raster-pixel coverage must be represented exactly.

Usage

cell_sample(cell, raster, method = c("simple", "bilinear"))

Arguments

cell

A globalhex_cell vector.

raster

A terra::SpatRaster.

method

Either "simple" for nearest-cell lookup or "bilinear".

Value

A hex_data() object with one row per input cell and one column per raster layer.