elev_file <- system.file("extdata/storml_elev.tif", package="gdalraster")
tmp_file <- "/vsimem/elev_temp.tif"
# Requires GDAL >= 3.7
if (as.integer(gdal_version()[2]) >= 3070000) {
result <- vsi_copy_file(elev_file, tmp_file)
print(result)
print(vsi_stat(tmp_file, "size"))
vsi_unlink(tmp_file)
}
Run the code above in your browser using DataLab