mapboxapi icon indicating copy to clipboard operation
mapboxapi copied to clipboard

consider check inputs of mb_isochrone

Open andypicke opened this issue 7 months ago • 0 comments

I just spent a while debugging why my call to mb_isochrone() wasn't working, and finally realized that I was passing in profile="Driving" instead of profile="driving" to the profile input. The error message wasn't very helpful:

x <- mb_geocode("Denver,CO", output = "sf") iso <- mb_isochrone(x,profile = "Driving", time = 5) Error in purrr::map2(): ℹ In index: 1. Caused by error: ! Not Found Run rlang::last_trace() to see where the error occurred.

My suggestion would be to change

profile="driving" in the definition of mb_isochrone() to:

profile = c("driving","walking","cycling","driving-traffic"), and add the line

profile = match.arg(profile) at the top of the function.

andypicke avatar Jul 20 '24 18:07 andypicke