-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetching NASA SRTM from MPC fails #383
Comments
library(terra)
#> terra 1.7.78
url1 <- "https://nasademeuwest.blob.core.windows.net/nasadem-cog/v001/NASADEM_HGT_s05e030.tif"
url2 <- "https://nasademeuwest.blob.core.windows.net/nasadem-cog/v001/NASADEM_HGT_s04e030.tif"
rast(paste0("/vsicurl/", url1))
#> Warning: HTTP response code: 409 (GDAL error 11)
#> Error: [rast] file does not exist: /vsicurl/https://nasademeuwest.blob.core.windows.net/nasadem-cog/v001/NASADEM_HGT_s05e030.tif
rast(paste0("/vsicurl?pc_url_signing=yes&url=", url2))
#> class : SpatRaster
#> dimensions : 3601, 3601, 1 (nrow, ncol, nlyr)
#> resolution : 0.0002777778, 0.0002777778 (x, y)
#> extent : 29.99986, 31.00014, -4.000139, -2.999861 (xmin, xmax, ymin, ymax)
#> coord. ref. : lon/lat WGS 84 (EPSG:4326)
#> source : NASADEM_HGT_s04e030.tif
#> name : NASADEM_HGT_s04e030 Created on 2024-10-13 with reprex v2.1.1 |
Hi @goergen95 , I indeed face this issue for the training on mapme.biodiversity and applications for impact evaluation that we are currently facilitating in Madagascar. Should I make a fork of the package, change the url by appending |
Why not merge those changes to main and point your students to the dev version via: remotes::install_github("https://github.com/mapme-initiative/mapme.biodiversity", dependencies = TRUE) Happy to receive a PR. Not sure yet when this will hit CRAN - but since we have some checks failing there, a new release might be required in the next days... |
hmmm. I'm affraid that it is not so easy. fps[["source"]] <- paste0("/vsicurl/", urls) with: fps[["source"]] <- paste0("/vsicurl?pc_url_signing=yes&url=", urls) But when I test it after load_all(), I get: aoi_path <- system.file("extdata", "gfw_sample.gpkg", package = "mapme.biodiversity")
aoi <- st_read(aoi_path, quiet = TRUE)
dir.create("test")
mapme_options(dir = "test")
aoi <- get_resources(
x = aoi,
get_nasa_srtm()
)
# R package 'progressr' recommended.
# Please install via `install.packages('progressr')`FALSE
#
# Attaching package: ‘purrr’
#
# The following object is masked from ‘package:testthat’:
#
# is_null
#
# There were 16 warnings (use warnings() to see them)
# > warnings()
# Warning messages:
# 1: In CPL_gdaltranslate(source, destination, options, oo, ... :
# GDAL Message 6: Unsupported option: pc_url_signing And the reprex you gave does not work with me:
terra is indeed 1.7-78 here. |
GDAL v3.4.1 is about three years old now. The mapme.biodiversity/DESCRIPTION Line 35 in cda74e6
|
Thanks @goergen95 . I'm affraid that this outdated GDAL version is the one shipped with |
You can find some images we are building off of rocker in mapme-docker. |
Wonderful, thanks! |
Calling
get_nasa_srtm()
fails because MPC now requires those URLs to be signedThe text was updated successfully, but these errors were encountered: