Skip to content

Error when output = "sf" and empty search_text #61

@etiennebacher

Description

@etiennebacher

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

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