writeRaster
to create .asc maps which can be read by GEOtopThis function uses writeRaster
to create .asc maps which can be read by GEOtop
writeRasterxGEOtop(
x,
filename = NULL,
overwrite = TRUE,
NAflag = -9999,
use.decimal.formatter = FALSE,
start.from.zero = FALSE,
keyword,
wpath,
suffix.ext = ".asc",
...
)
a Raster object, see writeRaster
. It can be also a RasterBrick-class
object.
see writeRaster
. It is a vector of string or one string containing a decimal formatter (see brick.decimal.formatter
) in case x
is a RasterBrick-class
object.
logical. Default is TRUE
, see writeRaster
.
numeric. Dafauli is -9999, see writeRaster
.
logical value. Default is FALSE
. If it is TRUE
or x
is a RasterBrick-class
object with nlayers(x)!=length(filename)
, filename
is considered as one string containing a decimal formatter (e.g. "%04d"
, see brick.decimal.formatter
). Otherwise, if filename
is considered as a vector string.
logical value. Default is FALSE
. If TRUE
the formatter starts from 0000
, otherwise it starts from 0001
.
geotop keyword to be used to extract the raster file name from geotop.inpts
file. This is enabled if filename
is equal to NULL
.
simulation folder containing geotop.inpts
file.
charachter string to be added to the keyword
value,e.g. possible suffix and extension of the raster file name. Default is ".asc"
.
further arguments of get.geotop.inpts.keyword.value
or writeRaster
library(geotopbricks)
## Simulation working path
file <- paste0("https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/template/",
"rendena100/SnowDepthMapFile-2014-MA-mean-winter-2013-2014.asc")
snow <- raster(file)
snowfile <- rasterTmpFile()
extension(snowfile) <- ".asc"
writeRasterxGEOtop(x=snow,file=snowfile)
Run the code above in your browser using DataLab