# NOT RUN {
user <- Sys.getenv("GEONAMES_USER")
occ_key <- name_suggest('Puma concolor')$key[1]
dat <- occ_search(taxonKey = occ_key, return = 'data', limit = 300,
hasCoordinate = TRUE)
head( elevation(dat, username = user) )
# Pass in a vector of lat's and a vector of long's
elevation(latitude = dat$decimalLatitude[1:10],
longitude = dat$decimalLongitude[1:10],
username = user, verbose = TRUE)
# Pass in lat/long pairs in a single vector
pairs <- list(c(31.8496,-110.576060), c(29.15503,-103.59828))
elevation(latlong=pairs, username = user)
# Pass on curl options
pairs <- list(c(31.8496,-110.576060), c(29.15503,-103.59828))
elevation(latlong=pairs, username = user, verbose = TRUE)
# different elevation models
lats <- dat$decimalLatitude[1:5]
lons <- dat$decimalLongitude[1:5]
elevation(latitude = lats, longitude = lons, elevation_model = "srtm3", verbose = TRUE)
elevation(latitude = lats, longitude = lons, elevation_model = "srtm1", verbose = TRUE)
elevation(latitude = lats, longitude = lons, elevation_model = "astergdem", verbose = TRUE)
elevation(latitude = lats, longitude = lons, elevation_model = "gtopo30", verbose = TRUE)
# }
Run the code above in your browser using DataLab