Generates a function to translate cell IDs from a source raster grid to a target raster grid, considering potential offsets and different dimensions. Handles cases where the target grid is a subset (e.g., cropped/masked) of the source grid.
define_translate(ncol_src, ncol_tgt, row_offset, col_offset)A function that takes a vector of source cell IDs (`cell_src`) and returns a vector of corresponding target cell IDs. Cells falling outside the target grid bounds will have `NA_integer_` as their target ID.
Integer. Number of columns in the source raster.
Integer. Number of columns in the target raster.
Integer. Row offset of the target grid's top-left corner relative to the source grid's top-left corner (0-based).
Integer. Column offset of the target grid's top-left corner relative to the source grid's top-left corner (0-based).