mapboxapi icon indicating copy to clipboard operation
mapboxapi copied to clipboard

Error when `output = "sf"` and empty `search_text`

Open etiennebacher opened this issue 4 months ago • 0 comments

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

etiennebacher avatar Aug 28 '25 09:08 etiennebacher