Skip to content

Commit

Permalink
rename elevations_get() to elevation_get() - singular for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
temospena committed Aug 17, 2021
1 parent 63ae644 commit 7ff342a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/slope_get.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/slopes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand Down
8 changes: 4 additions & 4 deletions man/elevations_get.Rd → man/elevation_get.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-get.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})

0 comments on commit 7ff342a

Please sign in to comment.