Skip to contents

For native raster SDMs on a different grid than the v8 0.05° (e.g. NCCOS density COGs). Zero-fills absent cells within the source extent then bilinear- resamples onto the cell grid (the same fade as AquaMaps) and returns (cell_id, value) for cells at/above min_value — the source's own values define coverage (no land mask; a marine SDM simply has no land values). A source already on the v8 topology (AquaX, Bio-Oracle) needs no resample — read it against cellid_tif directly.

Usage

cells_from_raster(
  r,
  cellid_tif,
  method = "bilinear",
  min_value = 1,
  zero_fill = TRUE,
  digits = 2
)

Arguments

r

a SpatRaster (single layer) in EPSG:4326

cellid_tif

path to the global cell-id COG

method

resampling method (default "bilinear"; use "near" for categorical)

min_value

drop resampled cells below this (default 1)

zero_fill

zero-fill NA within the source extent before resampling so the surface fades to 0 at its edge (default TRUE)

digits

rounding of val (default 2, the atlas' 0,100 precision). Pass a larger value, or NULL for none, when r holds NATIVE units rather than 0,100 — a density of 0.004 animals km^-2 rounds to 0 at two decimals, which is how the v8 gm ingest turned every low-density cetacean surface into a field of 0s and 100s (rescale BEFORE this call, or keep the digits).

Value

a tibble (cell_id integer, val double)