Description Usage Arguments Value Author(s) See Also Examples
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.
1 | get_srtm_raster(lon, lat, n = 1, exdir_srtm_hgt = "SRTM")
|
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. |
Raster image containing merged SRTM files.
Javier Saez Gallego
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.