Skip to content

Instantly share code, notes, and snippets.

@longwei66
longwei66 / google_elevation.R
Created August 10, 2019 22:34 — forked from italo-goncalves/google_elevation.R
R code to access the Google Elevation API. You will need a Google account and a developer key.
get_Google_Elevation <- function(lat, long, key){
# packages
require(httr)
require(jsonlite)
require(dplyr)
# setup
Ndata <- length(lat)
base_int <- 40 # max roughly 40 data points per request
Ncells <- ceiling(Ndata/base_int)