validate_raster_input: Validate Raster Input or Filepath

View source: R/validation.R

validate_raster_inputR Documentation

Validate Raster Input or Filepath

Description

Verifies that the provided input is either a valid terra::SpatRaster object or a valid file path pointing to an existing raster file on disk. If a file path is provided, it is automatically loaded as a SpatRaster.

Usage

validate_raster_input(x, arg_name = "image")

Arguments

x

An object or file path to check.

arg_name

Character string specifying the argument name for error messages.

Value

A terra::SpatRaster object.


GeoIndexR documentation built on Oct. 10, 2026, 5:08 p.m.