get_srtm_raster: 'get_srtm_raster' Given a pair of coordinates, find which...

Description Usage Arguments Value Author(s) See Also Examples

Description

get_srtm_raster Given a pair of coordinates, find which SRTM file to download. Basically, find all the surrounding files and return them as a merged raster.

Usage

1
get_srtm_raster(lon, lat, n = 1, exdir_srtm_hgt = "SRTM")

Arguments

lon

Longitude given in WGS84

lat

Latitude given in WGS84

n

Numbers of map tiles to gather around the specified coordinates. If n=1 (default), 9 tiles are merged, if n=2, 25 tiles are merged. In general, (2*n+1)^2 tiles are downloaded and merged so the computational time increases exponentially too. The length of the side of each tile is roughly 1 degree (approx 111km)

exdir_srtm_hgt

Default: "SRTM/". Folder where the maps are downloaded and unzipped. The zip file is deleted and only the .hgt files are kept. The folder is created if it does not exist.

Value

Raster image containing merged SRTM files.

Author(s)

Javier Saez Gallego

See Also

SRTM

Examples

1
2
3
4
5
6
# Download and plot maps around Mout Everest
library(SRTM)
everest =  get_srtm_raster(lon = 86.922623, lat = 27.986065 , n=0, exdir_srtm_hgt = "SRTM")
# Takes a while the first time
# See downloaded .hgt files in SRTM
raster::plot(everest)

jsga/SRTM_maps_in_R documentation built on May 20, 2019, 1:14 p.m.