get_aws_terrain: Get a digital elevation model from the AWS Terrain Tiles

View source: R/get_elev_raster.R

get_aws_terrainR Documentation

Get a digital elevation model from the AWS Terrain Tiles

Description

This function uses the AWS Terrain Tile service to retrieve an elevation raster from the geotiff service. It accepts a sf::st_bbox object as input and returns a single raster object covering that extent.

Usage

get_aws_terrain(
  locations,
  z,
  prj,
  expand = NULL,
  ncpu = ifelse(future::availableCores() > 2, 2, 1),
  serial = NULL,
  tmp_dir = tempdir(),
  ...
)

Arguments

locations

Either a data.frame of x (long) and y (lat), an sp, sf, or raster object as input.

z

The zoom level to return. The zoom ranges from 1 to 14. Resolution of the resultant raster is determined by the zoom and latitude. For details on zoom and resolution see the documentation from Mapzen at https://github.com/tilezen/joerd/blob/master/docs/data-sources.md#what-is-the-ground-resolution

prj

A valid input to st_crs If a sf object or a terra object is provided as the locations, the prj is optional and will be taken from locations. This argument is required for a data.frame of locations.

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 additional area around the feature is desired. Default is NULL.

ncpu

Number of CPU's to use when downloading aws tiles. Defaults to 2 if more than two available, 1 otherwise.

serial

Logical to determine if API should be hit in serial or in parallel. TRUE will use purrr, FALSE will use furrr.

tmp_dir

The location to store downloaded raster files. Defaults to a temporary location. Alternatively, the user may supply an existing path for these raster files. New folders are not created by get_elev_raster.

...

Extra configuration parameters to be passed to httr::GET. Common usage is to adjust timeout. This is done as config=timeout(x) where x is a numeric value in seconds. Multiple configuration functions may be passed as a vector.

Source

Attribution: Mapzen terrain tiles contain 3DEP, SRTM, and GMTED2010 content courtesy of the U.S. Geological Survey and ETOPO1 content courtesy of U.S. National Oceanic and Atmospheric Administration. https://github.com/tilezen/joerd/tree/master/docs


jhollist/elevatr documentation built on Sept. 24, 2024, 3:36 p.m.