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)
Run the code above in your browser using DataLab