diff --git a/NAMESPACE b/NAMESPACE index c71d8f7..2fdad66 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,7 +1,7 @@ # Generated by roxygen2: do not edit by hand export(elevation_extract) -export(elevations_get) +export(elevation_get) export(plot_slope) export(sequential_dist) export(slope_3d) diff --git a/R/slope_get.R b/R/slope_get.R index 1f09a21..49843d1 100644 --- a/R/slope_get.R +++ b/R/slope_get.R @@ -8,12 +8,12 @@ #' # time-consuming, and see #' # https://github.com/ITSLeeds/slopes/runs/648128378#step:18:107 #' routes = cyclestreets_route -#' # e = elevations_get(routes) +#' # e = elevation_get(routes) #' # class(e) #' # e #' # plot(e) #' # plot(sf::st_geometry(routes), add = TRUE) -elevations_get = function(routes, file = NULL, ...) { +elevation_get = function(routes, file = NULL, ...) { if(requireNamespace("ceramic")) { mid_ext = sf_mid_ext_lonlat(routes) bw = max(c(mid_ext$width, mid_ext$height)) / 1 # buffer width diff --git a/R/slopes.R b/R/slopes.R index 400f29d..c49a4f1 100644 --- a/R/slopes.R +++ b/R/slopes.R @@ -244,7 +244,7 @@ slope_3d = function( terra = has_terra() && methods::is(dem, "SpatRaster") ) { if(is.null(dem)) { - dem = elevations_get(routes) + dem = elevation_get(routes) r_original = routes # create copy to deal with projection issues routes = sf::st_transform(routes, raster::crs(dem)) suppressWarnings({sf::st_crs(routes) = sf::st_crs(r_original)}) diff --git a/man/elevations_get.Rd b/man/elevation_get.Rd similarity index 85% rename from man/elevations_get.Rd rename to man/elevation_get.Rd index b0e7d66..059d9d2 100644 --- a/man/elevations_get.Rd +++ b/man/elevation_get.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/slope_get.R -\name{elevations_get} -\alias{elevations_get} +\name{elevation_get} +\alias{elevation_get} \title{Get elevation data from hosted maptile services} \usage{ -elevations_get(routes, file = NULL, ...) +elevation_get(routes, file = NULL, ...) } \arguments{ \item{routes}{Routes, the gradients of which are to be calculated. @@ -21,7 +21,7 @@ Get elevation data from hosted maptile services # time-consuming, and see # https://github.com/ITSLeeds/slopes/runs/648128378#step:18:107 routes = cyclestreets_route -# e = elevations_get(routes) +# e = elevation_get(routes) # class(e) # e # plot(e) diff --git a/tests/testthat/test-get.R b/tests/testthat/test-get.R index 11a923b..2ed22ab 100644 --- a/tests/testthat/test-get.R +++ b/tests/testthat/test-get.R @@ -2,7 +2,7 @@ test_that("functions to get elevations from sf objects work", { if(nchar(Sys.getenv("MAPBOX_API_KEY")) < 8) skip(message = "Skipping test, MAPBOX token in .Renviron needed") r = cyclestreets_route - e = elevations_get(r) + e = elevation_get(r) expect_equal(class(e)[1], "RasterLayer") })