Learn R Programming

elevatr (version 0.1.3)

get_mapzen_terrain: Get a digital elevation model from the Mapzen Terrain Tiles

Description

This function uses the Mapzen Terrain Tile service to retrieve an elevation raster from the geotiff service. It accepts a sp::bbox object as input and returns a single raster object covering that extent. You should have an api_key from Mapzen.

Usage

get_mapzen_terrain(bbx, z, prj, api_key = NULL, expand = NULL, ...)

Arguments

bbx

a sp::bbox object that is used to select x,y,z tiles.

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://mapzen.com/documentation/terrain-tiles/data-sources/#what-is-the-ground-resolution

prj

PROJ.4 string for input bbox

api_key

An API Key from Mapzen, create at https://mapzen.com/developers Required. Set in your .Renviron file with the variable "mapzen_key"

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.

...

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.