@@ -5,6 +5,7 @@ if (!extracted) {
5
5
library(xml2 )
6
6
library(gdalraster )
7
7
dsn <- " /vsicurl/https://raw.githubusercontent.com/mdsumner/rema-ovr/main/REMA-2m_dem_ovr.vrt"
8
+ # #dsn <- "/vsicurl/https://opentopography.s3.sdsc.edu/raster/COP30/COP30_hh.vrt"
8
9
url <- gsub(" /vsicurl/" , " " , dsn )
9
10
xml <- read_xml(url )
10
11
dst <- xml | > xml_find_all(" .//DstRect" )
@@ -62,11 +63,12 @@ extract_pt <- function(x) {
62
63
# bbbbb <- paste0(bbox, collapse = ",")
63
64
# dsn <- glue::glue("vrt://{dsn}?projwin={bbbbb}")
64
65
translate(dsn , tf , cl_arg = c(" -projwin" , unname(bbox [c(1 , 4 , 3 , 2 )])), quiet = TRUE )
65
- pixel_extract(new(GDALRaster , dsn ), pts )
66
+ pixel_extract(new(GDALRaster , tf ), pts )
66
67
}
67
68
68
69
69
70
v <- vector(" list" , length(unique(tile )))
71
+ # # create the payload
70
72
for (i in seq_along(v )) {
71
73
tib <- tibble :: tibble(dsn = dsn , X = xy [tile == unique(tile )[i ],1 , drop = TRUE ],
72
74
Y = xy [tile == unique(tile )[i ],2 , drop = TRUE ],
@@ -77,7 +79,7 @@ for (i in seq_along(v)) {
77
79
options(parallelly.fork.enable = TRUE , future.rng.onMisuse = " ignore" )
78
80
library(furrr ); plan(multicore )
79
81
80
- v <- future_map(v , extract_pt )
82
+ v1 <- future_map(v , extract_pt )
81
83
82
84
83
85
# for (i in seq_along(v)) {
@@ -88,6 +90,6 @@ v <- future_map(v, extract_pt)
88
90
89
91
ds $ close()
90
92
91
- track $ elev <- unlist(v )
93
+ track $ elev <- unlist(v1 )
92
94
nanoparquet :: write_parquet(track , " longlat_points_dem.parquet" )
93
95
}
0 commit comments