View source: R/00_read_block.R
vapour_write_raster_block | R Documentation |
Be careful! The write function doesn't create a file, you have to use an existing one. Don't write to a file you don't want to update by mistake.
vapour_write_raster_block(
dsource,
data,
offset,
dimension,
band = 1L,
overwrite = FALSE
)
dsource |
data source name |
data |
data vector, length should match |
offset |
offset to start |
dimension |
dimension to write |
band |
which band to write to (1-based) |
overwrite |
set to FALSE as a safety valve to not overwrite an existing file |
a logical value indicating success (or failure) of the write
f <- system.file("extdata", "sst.tif", package = "vapour")
v <- vapour_read_raster_block(f, c(0L, 0L), dimension = c(2L, 3L), band = 1L)
file.copy(f, tf <- tempfile(fileext = ".tif"))
try(vapour_write_raster_block(tf, data = v[[1]], offset = c(0L, 0L),
dimension = c(2L, 3L), band = 1L))
if (file.exists(tf)) file.remove(tf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.