Skip to content

Commit

Permalink
Improve documentation of elevation_extract() for #32
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Aug 30, 2021
1 parent 7a67e2d commit 18b0a5d
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
30 changes: 30 additions & 0 deletions R/slopes.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,36 @@ slope_xyz = function(route_xyz, fun = slope_matrix_weighted, lonlat = TRUE) {

#' Extract elevations from coordinates
#'
#' This function takes a series of points located in geographical space
#' and a digital elevation model as inputs and returns a vector of
#' elevation estimates associated with each point.
#' The function takes locations
#' represented as a matrix of XY (or longitude latitude) coordinates
#' and a digital elevation model (DEM) with class `raster` or `terra`.
#' It returns a vector of values representing estimates of elevation
#' associated with each of the points.
#'
#' By default, the elevations are estimated using
#' [bilinear interpolation](https://en.wikipedia.org/wiki/Bilinear_interpolation)
#' (`method = "bilinear"`)
#' which calculates point height based on proximity to the centroids of
#' surrounging cells.
#' The value of the `method` argument is passed to the `method` argument in
#' [`raster::extract()`](https://rspatial.github.io/raster/reference/extract.html)
#' or
#' [`terra::extract()`](https://rspatial.github.io/terra/reference/extract.html)
#' depending on the class of the input raster dataset.
#'
#' See Kidner et al. (1999)
#' for descriptions of alternative elevation interpolation and extrapolation
#' algorithms.
#'
#' @references
#' Kidner, David, Mark Dorey, and Derek Smith.
#' "What’s the point? Interpolation and extrapolation with a regular grid DEM."
#' Fourth International Conference on GeoComputation, Fredericksburg,
#' VA, USA. 1999.
#'
#' @inheritParams slope_raster
#' @inheritParams slope_matrix
#' @return A vector of elevation values.
Expand Down
31 changes: 30 additions & 1 deletion man/elevation_extract.Rd

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

0 comments on commit 18b0a5d

Please sign in to comment.