mapboxapi
mapboxapi copied to clipboard
Error when `output = "sf"` and empty `search_text`
Passing an empty string to mb_geocode() returns NULL. Maybe it should return NA instead, I don't know, but the issue is that it errors if output = "sf" is mentioned. I guess it should return an empty point instead?
library(mapboxapi)
#> Usage of the Mapbox APIs is governed by the Mapbox Terms of Service.
#> Please visit https://www.mapbox.com/legal/tos/ for more information.
mb_geocode(search_text = "")
#> NULL
mb_geocode(search_text = "", output = "sf")
#> Error in `[.data.frame`(x, i, j, drop = drop): undefined columns selected