Skip to content

gh_get_route() produces encoding error #17

Description

@joshpersi

Hello,

When I run the following code:

library(graphhopper)

key <- "your-api-key" ## with 'your-api-key' is replaced with my 36-character-long graphhopper api with hyphens included
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()

I get the following error:
No encoding supplied: defaulting to UTF-8. Error in decode.default(path$points) : I don't know how to decode this object

Would anyone be able to help me understand this error? I'm a first-time API user so my gut is telling me I'm somehow using the API wrong.

Many thanks for your help,

Josh

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions