Skip to contents

Bind hyperspectral SpatRasters along the y-axis

Usage

hsi_bind_rows(x, filename = "", overwrite = FALSE, ...)

Arguments

x

List of SpatRaster objects with hyperspectral data, in the desired top-to-bottom order. All elements must share the same number of layers, layer names, and spatial resolution.

filename

Character. Output filename. Default "" keeps result in memory.

overwrite

Logical. Overwrite existing file. Default FALSE.

...

Additional arguments passed to terra::merge().

Value

A SpatRaster with all inputs bound along the y-axis in the order provided.

Details

Concatenates SpatRasters along the y-axis in the order provided. All rasters are left-aligned to xmin = 0. Rasters narrower than the widest input are padded with NA columns on the right via terra::extend(), so the output forms a rectangular block rather than a Tetris-like shape.

Resolution, layer count, and layer names (wavelengths) must be identical across all inputs — the function aborts if any mismatch is detected.

Examples

if (FALSE) { # \dontrun{
sections <- list(section_01, section_02, section_03, section_04)
x_bound <- hsi_bind_rows(sections, filename = "bound.tif", overwrite = TRUE)
} # }