walkerke / mapboxapi

R interface to Mapbox web services
https://walker-data.com/mapboxapi/
Other
109 stars 8 forks source link

consider check inputs of mb_isochrone #54

Open andypicke opened 1 month ago

andypicke commented 1 month ago

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.