if (FALSE) { # isTRUE(as.logical(Sys.getenv("R_RGEEDIM_RUN_EXAMPLES"))) && gd_is_initialized()
# \donttest{
r <- gd_bbox(
xmin = -121,
xmax = -120.5,
ymin = 38.5,
ymax = 39
)
if (gd_is_initialized()) {
x <- gd_image_from_id('CSP/ERGo/1_0/Global/SRTM_topoDiversity')
tf <- tempfile(fileext = ".tif")
# fast sample download at 10x aggregation (900m v.s. 90m)
img <- gd_download(x, filename = tf,
region = r, scale = 900,
overwrite = TRUE, silent = FALSE)
if (requireNamespace("terra")) {
library(terra)
f <- rast(img)
plot(f[[1]])
# inspect object
f
}
unlink(tf)
}
# }
}
Run the code above in your browser using DataLab