Skip to content

Commit

Permalink
documentation updates and drop progress suggests (closes #86)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhollist committed Sep 8, 2023
1 parent e404e20 commit 401ac5e
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 76 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Expand Up @@ -44,6 +44,5 @@ Suggests:
testthat,
knitr,
rmarkdown,
formatR,
progress
formatR
VignetteBuilder: knitr
15 changes: 6 additions & 9 deletions R/get_elev_point.R
Expand Up @@ -3,9 +3,9 @@
#' This function provides access to point elevations using either the USGS
#' Elevation Point Query Service (US Only) or by extracting point elevations
#' from the AWS Terrain Tiles. The function accepts a \code{data.frame} of x
#' (long) and y (lat) or a \code{SpatialPoints}/\code{SpatialPointsDataFame} as
#' input. A SpatialPointsDataFrame is returned with elevation as an added
#' \code{data.frame}.
#' (long) and y (lat) or a \code{sf} \code{POINT} or \code{MULTIPOINT} object as
#' input. A \code{sf} \code{POINT} or \code{MULTIPOINT} object is returned with
#' elevation and elevation units as an added \code{data.frame}.
#'
#'
#' @param locations Either a \code{data.frame} with x (e.g. longitude) as the
Expand All @@ -14,12 +14,9 @@
#' \code{sf} \code{POINT} or \code{MULTIPOINT} object.
#' Elevation for these points will be returned in the
#' originally supplied class.
#' @param prj A string defining the projection of the locations argument. The
#' string needs to be an acceptable SRS_string for
#' \code{\link[sp]{CRS-class}} for your version of PROJ. If a \code{sf}
#' object, a \code{sp} object or a \code{raster} object
#' is provided, the string will be taken from that. This
#' argument is required for a \code{data.frame} of locations.
#' @param prj A valid input to \code{\link{st_crs}}. This
#' argument is required for a \code{data.frame} of locations and optional
#' for \code{sf} locations.
#' @param src A character indicating which API to use, either "epqs" or "aws"
#' accepted. The "epqs" source is relatively slow for larger numbers
#' of points (e.g. > 500). The "aws" source may be quicker in these
Expand Down
40 changes: 18 additions & 22 deletions R/get_elev_raster.R
@@ -1,10 +1,11 @@
#' Get Raster Elevation
#'
#' Several web services provide access to raster elevation. Currently, this
#' function provides access to the Amazon Web Services Terrian Tiles and the
#' function provides access to the Amazon Web Services Terrain Tiles and the
#' Open Topography global datasets API. The function accepts a \code{data.frame}
#' of x (long) and y (lat), an \code{sf}, or \code{terra} object as input. A
#' \code{raster} object is returned.
#' \code{RasterLayer} object is returned. In subsequent versions, a \code{SpatRaster}
#' will be returned.
#'
#' @param locations Either a \code{data.frame} of x (long) and y (lat), an
#' \code{sf}, or \code{terra} object as input.
Expand All @@ -13,11 +14,9 @@
#' details on zoom and resolution see the documentation from Mapzen at
#' \url{https://github.com/tilezen/joerd/blob/master/docs/data-sources.md#what-is-the-ground-resolution}.
#' The z is not required for the OpenTopography data sources.
#' @param prj A string defining the projection of the locations argument. The
#' string needs to be an acceptable SRS_string for
#' \code{\link[sp]{CRS-class}} for your version of PROJ. If a \code{sf}
#' object, a \code{sp} object or a \code{raster} object
#' is provided, the string will be taken from that. This
#' @param prj A valid input to \code{\link{st_crs}} If a \code{sf}
#' object or a \code{terra} object is provided as the \code{locations},
#' the prj is optional and will be taken from \code{locations}. This
#' argument is required for a \code{data.frame} of locations.
#' @param src A character indicating which API to use. Currently supports "aws"
#' and "gl3", "gl1", "alos", or "srtm15plus" from the OpenTopography API global
Expand All @@ -32,7 +31,7 @@
#' The default value is "tile" which returns the full tiles. Other
#' options are "bbox" which returns the DEM clipped to the bounding
#' box of the original locations (or expanded bounding box if used),
#' or "locations" if the spatials data (e.g. polygons) in the input
#' or "locations" if the spatial data (e.g. polygons) in the input
#' locations should be used to clip the DEM. Locations are not used
#' to clip input point datasets. Instead the bounding box is used.
#' @param verbose Toggles on and off the note about units and coordinate
Expand All @@ -49,9 +48,10 @@
#' @param ... Extra arguments to pass to \code{httr::GET} via a named vector,
#' \code{config}. See
#' \code{\link{get_aws_terrain}} for more details.
#' @return Function returns a \code{SpatRaster} in the projection
#' @return Function returns a \code{RasterLayer} in the projection
#' specified by the \code{prj} argument or in the projection of the
#' provided locations.
#' provided locations. In subsequent versions, a \code{SpatRaster}
#' will be returned.
#' @details Currently, the \code{get_elev_raster} function utilizes the
#' Amazon Web Services
#' (\url{https://registry.opendata.aws/terrain-tiles/}) terrain
Expand Down Expand Up @@ -170,12 +170,10 @@ get_elev_raster <- function(locations, z, prj = NULL,
#' of the resultant raster is determined by the zoom and latitude. For
#' details on zoom and resolution see the documentation from Mapzen at
#' \url{https://github.com/tilezen/joerd/blob/master/docs/data-sources.md#what-is-the-ground-resolution}
#' @param prj A string defining the projection of the locations argument. The
#' string needs to be an acceptable SRS_string for
#' \code{\link[sp]{CRS-class}} for your version of PROJ. If a \code{sf}
#' object, a \code{sp} object or a \code{raster} object
#' is provided, the string will be taken from that. This
#' argument is required for a \code{data.frame} of locations.
#' @param prj A valid input to \code{\link{st_crs}} If a \code{sf}
#' object or a \code{terra} object is provided as the \code{locations},
#' the prj is optional and will be taken from \code{locations}. This
#' argument is required for a \code{data.frame} of locations.
#' @param expand A numeric value of a distance, in map units, used to expand the
#' bounding box that is used to fetch the terrain tiles. This can
#' be used for features that fall close to the edge of a tile and
Expand Down Expand Up @@ -341,12 +339,10 @@ merge_rasters <- function(raster_list, target_prj, method = "bilinear", returnR
#'
#' @param locations Either a \code{data.frame} of x (long) and y (lat), an
#' \code{sp}, an \code{sf}, or \code{raster} object as input.
#' @param prj A string defining the projection of the locations argument. The
#' string needs to be an acceptable SRS_string for
#' \code{\link[sp]{CRS-class}} for your version of PROJ. If a \code{sf}
#' object, a \code{sp} object or a \code{raster} object
#' is provided, the string will be taken from that. This
#' argument is required for a \code{data.frame} of locations.
#' @param prj A valid input to \code{\link{st_crs}} If a \code{sf}
#' object or a \code{terra} object is provided as the \code{locations},
#' the prj is optional and will be taken from \code{locations}. This
#' argument is required for a \code{data.frame} of locations.
#' @param expand A numeric value of a distance, in map units, used to expand the
#' bounding box that is used to fetch the SRTM data.
#' @param ... Extra configuration parameters to be passed to httr::GET. Common
Expand Down
4 changes: 1 addition & 3 deletions README.Rmd
Expand Up @@ -33,16 +33,14 @@ Version `r version` of this package is currently available from CRAN and may be
install.packages("elevatr")
```

NOTE: As of `r lubridate::today()`, the CRAN version is the older version that does not support `terra`.

The development version (this repo) may installed with `devtools`:

```{r, eval=F}
library(devtools)
install_github("jhollist/elevatr")
```

NOTE: As of `r lubridate::today()`, the development version on GitHub, `r packageVersion("elevatr")`, is the latest version and supports `sf` and `terra`. Support for `sp` and `raster` has been deprecated.
NOTE: As of `r lubridate::today()`, the development version on GitHub, `r packageVersion("elevatr")`, is the latest version and supports `sf` and `terra`.

## Contributions and Use Cases

Expand Down
4 changes: 2 additions & 2 deletions man/bbox_to_sf.Rd

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

13 changes: 6 additions & 7 deletions man/get_aws_terrain.Rd

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

15 changes: 6 additions & 9 deletions man/get_elev_point.Rd

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

24 changes: 12 additions & 12 deletions man/get_elev_raster.Rd

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

8 changes: 3 additions & 5 deletions man/get_opentopo.Rd

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

0 comments on commit 401ac5e

Please sign in to comment.