Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SRTM GL1 Ellipsoidal dataset from OpenTopography #82

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions R/get_elev_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' 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
#' and "gl3", "gl1", "gl1e", "alos", or "srtm15plus" from the OpenTopography API global
#' datasets. "aws" is the default.
#' @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
Expand Down Expand Up @@ -86,7 +86,7 @@
#' }

get_elev_raster <- function(locations, z, prj = NULL,
src = c("aws", "gl3", "gl1", "alos", "srtm15plus"),
src = c("aws", "gl3", "gl1", "gl1e", "alos", "srtm15plus"),
expand = NULL, clip = c("tile", "bbox", "locations"),
verbose = TRUE, neg_to_na = FALSE,
override_size_check = FALSE, tmp_dir = tempdir(), ...){
Expand Down Expand Up @@ -129,9 +129,9 @@ get_elev_raster <- function(locations, z, prj = NULL,

# Pass of locations to APIs to get data as raster
if(src == "aws") {
} else if(src %in% c("gl3", "gl1", "gl1e", "alos", "srtm15plus")){
raster_elev <- get_aws_terrain(locations, z, prj = prj, expand = expand,
tmp_dir = tmp_dir, ...)
} else if(src %in% c("gl3", "gl1", "alos", "srtm15plus")){
raster_elev <- get_opentopo(locations, src, prj = prj, expand = expand,
tmp_dir = tmp_dir, ...)
}
Expand Down Expand Up @@ -387,6 +387,7 @@ get_opentopo <- function(locations, src, prj, expand=NULL, tmp_dir = tempdir(),
data_set <- switch(src,
gl3 = "SRTMGL3",
gl1 = "SRTMGL1",
gl1e = "SRTMGL1_E",
alos = "AW3D30",
srtm15plus = "SRTM15Plus")

Expand Down
2 changes: 2 additions & 0 deletions R/internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ estimate_raster_size <- function(locations, prj, src, z = NULL){
aws = 32,
gl3 = 32,
gl1 = 32,
gl1e = 32,
alos = 32,
srtm15plus = 32)
if(src == "aws"){
Expand All @@ -219,6 +220,7 @@ estimate_raster_size <- function(locations, prj, src, z = NULL){
res <- switch(src,
gl3 = 0.0008333,
gl1 = 0.0002778,
gl1e = 0.0002778,
alos = 0.0002778,
srtm15plus = 0.004165)
}
Expand Down