Skip to content

Commit

Permalink
Add example using API key
Browse files Browse the repository at this point in the history
  • Loading branch information
crazycapivara committed Jul 17, 2021
1 parent 7f6b35c commit 9542e20
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/graphhopper-use-api-key.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
library(graphhopper)

key <- "your-api-key"
Sys.setenv(GH_API_KEY = key)

gh_set_api_url("https://graphhopper.com/api/1/")

start_point <- c(52.592204, 13.414307)
end_point <- c(52.539614, 13.364868)

gh_get_route(list(start_point, end_point)) %>%
gh_as_sf()

0 comments on commit 9542e20

Please sign in to comment.