Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am longwei66 on github.
  • I am longwei (https://keybase.io/longwei) on keybase.
  • I have a public key ASAjhwQDPjaQj3v7Xgzm42luLVCMQijk7ecgzrRHRuWUeQo

To claim this, I am signing this object:

@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)