https://bsky.app/profile/mdsumner.bsky.social/post/3lt4lhylxhs2v
info <- vapour::vapour_raster_info(dsn <- "/vsicurl/https://projects.pawsey.org.au/idea-gebco-tif/GEBCO_2024.tif")
## remotes::install_github("hypertidy/grout")
g <- grout::grout(info$dimension, info$extent, blocksize = info$block)
idx <- grout::tile_index(g)
options(parallelly.fork.enable = TRUE, future.rng.onMisuse = "ignore")
library(furrr); plan(multicore)
fun <- function(x) {
ex <- unlist(x[1, c("xmin", "xmax", "ymin", "ymax")])
dsn <- "/vsicurl/https://projects.pawsey.org.au/idea-gebco-tif/GEBCO_2024.tif"
r <- terra::crop(terra::rast(dsn), terra::ext(ex))
v <- terra::values(r)
w <- which(v == 4326)
if (length(w) < 1) return(NULL)
terra::xyFromCell(r, w)
}
m <- future_map(split(idx, 1:nrow(idx)), fun)
plot(rast(sprintf("vrt://%s?ovr=5", sds::gebco())))
points(do.call(rbind, m), pch = 19, cex = .4, col = "hotpink")
plan(sequential)