if (FALSE) {
tif = system.file("tif/L7_ETMs.tif", package = "stars")
r = read_stars(tif, proxy = TRUE)
tiles = st_tile(nrow(r), ncol(r), 256, 256)
for (i in seq_len(nrow(tiles))) {
tile = read_stars(tif, proxy = FALSE, RasterIO = tiles[i, ])
# write tiles to separate files
write_stars(tile, dsn = paste0(i, ".tif"))
}
}
Run the code above in your browser using DataLab