Skip to contents

Checks that an object is a readable terra::SpatRaster with dimensions, layers, and values suitable for terrain analysis.

Usage

validate_bathy(
  x,
  require_crs = FALSE,
  require_values = TRUE,
  allow_multi = FALSE
)

Arguments

x

A raster-like object accepted by as_bathy().

require_crs

Logical. If TRUE, require a declared CRS.

require_values

Logical. If TRUE, require raster values.

allow_multi

Logical. If FALSE, warn when more than one layer is supplied.

Value

Invisibly returns the input raster.

Details

Validation does not decide whether values represent positive depth or negative elevation. Use check_bathy_units(), set_depth_positive(), or set_depth_negative() when sign convention matters.

Examples

bathy <- read_bathy(blueterra_example("bathy"))
validate_bathy(bathy)