Write a SpatRaster object to a file.
# S4 method for SpatRaster,character
writeRaster(x, filename,
overwrite=FALSE, wopt=list(), ...)
SpatRaster
character. Output filename
logical. If TRUE
, filename
is overwritten
list. Options for writing files. See Details
additional arguments. None implemented
SpatRaster. This function is used for the side-effect of writing values to a file.
In many methods, options for writing raster files to disk can be provided with the wopt
argument. wopt
should be a named list. The following options are available:
name | description |
|
values for datatype are "INT1U", "INT2U", "INT2S", "INT4U", "INT4S", "FLT4S", "FLT8S". The first three letters indicate whether the datatype is integer (whole numbers) of a real number (decimal numbers), the fourth character indicates the number of bytes used (allowing for large numbers and/or more precision), and the "S" or "U" indicate whether the values are signed (both negative and positive) or unsigned (postive values only). |
|
file format expresses as GDAL driver names. If this argument is not supplied, the driver is derived from the filename. |
|
GDAL driver specific datasource creation options. See the GDAL documentation. For example, with the GeoTiff file format you can use gdal=c("COMPRESS=LZW", "TFW=YES") . |
|
the path where temporary files are to be written to. |
|
postive integer. If the number of chunks is larger, a progress bar is shown. |
|
numeric between 0.1 and 0.9. The fraction of available RAM that terra is allowed to use. |
|
output layer names. |
|
numeric. value to represent missing (NA or NaN ) values. |
|
logical. If TRUE debugging information is printed. |
|
logical. If TRUE processing operates as if the dataset is very large and needs to be written to a temporary file (for debugging). |
see writeCDF
for writing NetCDF files.