mapbox_dem: Gets Digital Elevation Model (DEM) data from 'mapbox'

Description Usage Arguments Value Examples

View source: R/mapbox_dem.R

Description

Gets Digital Elevation Model (DEM) data from 'mapbox'

Usage

1
mapbox_dem(lat, long, square_km, width_buffer = 1, max_tiles = 10, api_key)

Arguments

lat

WGS84 latitude. Either a single point to use as the centre for a square_km sized raster, or a vector of track points

long

WGS84 longitude. Either a single point to use as the centre for a square_km sized raster, or a vector of track points

square_km

length of one edge the required square area, in km. Ignored if lat and long have length > 1

width_buffer

If lat and long have length > 1, used as buffer distance around the provided points in km

max_tiles

maximum number of map tiles to request. More tiles will give higher resolution scenes but take longer to download. Note that very small numbers of tiles may result in a scene that is not square.

api_key

'Mapbox' API key

Value

a raster with values corresponding to terrain height in metres

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
#NOT RUN
#mapbox_dem() requires a 'mapbox' API key

mapbox_key = "YOUR_MAPBOX_API_KEY"

lat = 54.4502651
long = -3.1767946
square_km = 20

dem <- mapbox_dem(lat, long, square_km, api_key = mapbox_key)


## End(Not run)

geoviz documentation built on March 26, 2020, 9:15 p.m.