write_raster: Write raster data to a file.

View source: R/read_write_idf.r

write_rasterR Documentation

Write raster data to a file.

Description

Writes a terra::SpatRaster object to a file, using one of the supported formats in the 'terra' package. or an idf file format (ref. https://oss.deltares.nl/web/imod). In that case, use the'.idf' extension in the filename.

Usage

write_raster(
  x,
  filename,
  e = NULL,
  funstr = NULL,
  double_precision = FALSE,
  ...
)

Arguments

x

terra::SpatRaster object.

filename

Output filename(s). In case "x" contains multiple layers and idf-output files are needed, specify a character vector of filenames (character).

e

Terra extent object

funstr

Optional function to modify raster values. Denote the raster with 'x' (or character between square brackets) (character)

double_precision

Write double precision idf. Only meaningfull for writing idf-files (logical).

...

Additional arguments as in 'terra::writeRaster'.

Value

This function is used for the side-effect of writing values to a file.


KeesVanImmerzeel/idf documentation built on Jan. 13, 2025, 3:23 a.m.