From e1ded7e579cb55e4244a440c12dcf55c25872ca2 Mon Sep 17 00:00:00 2001 From: Joan Maspons Date: Thu, 27 Aug 2026 19:21:07 +0200 Subject: [PATCH 1/2] Update death links to https://srtm.csi.cgiar.org/srtmdata/ --- DESCRIPTION | 2 +- NEWS.md | 1 + R/elevation.R | 18 ++++++++---------- man/osm_elevation.Rd | 13 ++++++++----- vignettes/osmdata-sc.Rmd | 16 ++++++---------- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3a697495..573ad2a5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: osmdata Title: Import 'OpenStreetMap' Data as Simple Features or Spatial Objects -Version: 0.4.0.9002 +Version: 0.4.0.9003 Authors@R: c( person("Joan", "Maspons", , "joanmaspons@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2286-8727")), diff --git a/NEWS.md b/NEWS.md index bb25d09b..9335636d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,7 @@ - Fix `osmdata_sf()` for points without metadata (#426). - Add user agent in requests to servers (#430). +- Update death links (#433). # osmdata 0.4.0 diff --git a/R/elevation.R b/R/elevation.R index cc8bf2c5..16f2d6f8 100644 --- a/R/elevation.R +++ b/R/elevation.R @@ -1,15 +1,19 @@ #' osm_elevation #' #' Add elevation data to a previously-extracted OSM data set, using a -#' pre-downloaded global elevation file from -#' \url{https://srtm.csi.cgiar.org/srtmdata/}. Currently only works for -#' `SC`-class objects returned from [osmdata_sc()]. +#' pre-downloaded elevation file. Currently only works for `SC`-class objects returned +#' from [osmdata_sc()]. #' #' @param dat An `SC` object produced by [osmdata_sc()]. #' @param elev_file A vector of one or more character strings specifying paths #' to `.tif` files (or anything that \pkg{terra} can read) containing global #' elevation data. `.zip` files will be uncompressed. #' +#' @details Elevation data can be downloaded from +#' \url{https://portal.opentopography.org/raster?opentopoID=OTSRTM.082015.4326.1}, +#' \url{https://www.earthdata.nasa.gov/data/catalog/lpcloud-srtmgl1-003} or similar. +#' +#' #' @return A modified version of the input `dat` with an additional `z_` column #' appended to the vertices. #' @family transform @@ -22,8 +26,7 @@ #' dat <- osmdata_sc (query) #' dat$vertex #' # The vertex table will have columns ("x_", "y_", "vertex_"). Then -#' # download elevation data from \url{https://srtm.csi.cgiar.org/srtmdata/} -#' # (or elsewhere), and add elevation column, "z_" with: +#' # download elevation data, and add elevation column, "z_" with: #' dat <- osm_elevation (dat, elev_file = "/path/to/elevation/data.tiff") #' } #' @export @@ -31,11 +34,6 @@ osm_elevation <- function (dat, elev_file) { requireNamespace ("terra", quietly = TRUE) - message ( - "Elevation data from Consortium for Spatial Information; ", - "see http://srtm.csi.cgiar.org/srtmdata/" - ) - elev_file <- check_elev_file (elev_file) if (length (elev_file) > 1) { stop ("not yet") diff --git a/man/osm_elevation.Rd b/man/osm_elevation.Rd index 411dce3a..4b6ca9ab 100644 --- a/man/osm_elevation.Rd +++ b/man/osm_elevation.Rd @@ -19,9 +19,13 @@ appended to the vertices. } \description{ Add elevation data to a previously-extracted OSM data set, using a -pre-downloaded global elevation file from -\url{https://srtm.csi.cgiar.org/srtmdata/}. Currently only works for -\code{SC}-class objects returned from \code{\link[=osmdata_sc]{osmdata_sc()}}. +pre-downloaded elevation file. Currently only works for \code{SC}-class objects returned +from \code{\link[=osmdata_sc]{osmdata_sc()}}. +} +\details{ +Elevation data can be downloaded from +\url{https://portal.opentopography.org/raster?opentopoID=OTSRTM.082015.4326.1}, +\url{https://www.earthdata.nasa.gov/data/catalog/lpcloud-srtmgl1-003} or similar. } \examples{ \dontrun{ @@ -31,8 +35,7 @@ query <- opq ("omaha nebraska") |> dat <- osmdata_sc (query) dat$vertex # The vertex table will have columns ("x_", "y_", "vertex_"). Then -# download elevation data from \url{https://srtm.csi.cgiar.org/srtmdata/} -# (or elsewhere), and add elevation column, "z_" with: +# download elevation data, and add elevation column, "z_" with: dat <- osm_elevation (dat, elev_file = "/path/to/elevation/data.tiff") } } diff --git a/vignettes/osmdata-sc.Rmd b/vignettes/osmdata-sc.Rmd index 08a87dfe..3d0f621c 100644 --- a/vignettes/osmdata-sc.Rmd +++ b/vignettes/osmdata-sc.Rmd @@ -66,9 +66,11 @@ networks that accounts for elevation changes. Incorporating elevation data with OSM data currently requires local storage of desired elevation data. These must be downloaded for the desired region from -[http://srtm.csi.cgiar.org/srtmdata](https://srtm.csi.cgiar.org/srtmdata/) in Geo -TIFF format. Elevation data may then be incorporated with -[`silicate`](https://github.com/hypertidy/silicate)-format data generated by +[https://portal.opentopography.org/raster?opentopoID=OTSRTM.082015.4326.1], +[https://www.earthdata.nasa.gov/data/catalog/lpcloud-srtmgl1-003] or other sites in Geo +TIFF format or any other compatible with \pkg{terra}. Elevation data may then be +incorporated with [`silicate`](https://github.com/hypertidy/silicate)-format data +generated by [`x <- osmdata_sc()`](https://docs.ropensci.org/osmdata/reference/osmdata_sc.html) through the `osm_elevation()` function. The entire procedure is demonstrated with the following lines: @@ -102,13 +104,7 @@ Incorporating elevation data is then as simple as ```{r osm_elevation, eval = FALSE} dat <- osm_elevation (dat, elev_file = "/path/to/elevation/data/filename.tiff") ``` -```{r osm_elevation2, echo = FALSE} -message ( - "Loading required namespace: raster\n", - "Elevation data from Consortium for Spatial Information; see ", - "https://srtm.csi.cgiar.org/srtmdata/" -) -``` + This function then simply appends the elevation values to the `vertex_` table, so that it now looks like this: ```{r dat_vertex2, eval = FALSE} From 131e167121d7cc35c79f6e30702f0a0dda752d91 Mon Sep 17 00:00:00 2001 From: Joan Maspons Date: Mon, 31 Aug 2026 16:37:16 +0200 Subject: [PATCH 2/2] Update R/elevation.R Co-authored-by: mark padgham --- R/elevation.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/elevation.R b/R/elevation.R index 16f2d6f8..e00e27e3 100644 --- a/R/elevation.R +++ b/R/elevation.R @@ -1,7 +1,7 @@ #' osm_elevation #' #' Add elevation data to a previously-extracted OSM data set, using a -#' pre-downloaded elevation file. Currently only works for `SC`-class objects returned +#' pre-downloaded elevation file (see Details). Currently only works for `SC`-class objects returned #' from [osmdata_sc()]. #' #' @param dat An `SC` object produced by [osmdata_sc()].