mb_geocode {mapboxapi} | R Documentation |
Geocode an address or place description using the Mapbox Geocoding API
Description
See the Mapbox Geocoding API documentation for more information.
Usage
mb_geocode(
search_text = NULL,
structured_input = NULL,
permanent = FALSE,
autocomplete = TRUE,
limit = 1,
types = NULL,
search_within = NULL,
language = NULL,
country = NULL,
proximity = NULL,
worldview = NULL,
output = "coordinates",
access_token = NULL
)
mb_reverse_geocode(
coordinates,
permanent = FALSE,
limit = 1,
language = NULL,
types = NULL,
country = NULL,
worldview = NULL,
output = "text",
access_token = NULL
)
Arguments
search_text |
The text to search, formatted as a character string. Can be an address, a location, or a description of a point of interest. |
structured_input |
A named list of structured address inputs, to be used in place of |
permanent |
Either FALSE (the default) when results are not intended to be stored, or TRUE if the results are planned to be stored. |
autocomplete |
Whether or not to return autocomplete results. Defaults to FALSE. |
limit |
How many results to return; defaults to 1 (maximum 10). |
types |
A vector of feature types to limit to which the search should be
limited. Available options include |
search_within |
An |
language |
The user's language, which can help with interpretation of queries. Available languages are found at https://docs.mapbox.com/api/search/#language-coverage. |
country |
A character string or vector of ISO 3166 alpha-2 country codes within which you would like to limit your search. |
proximity |
Either a vector of coordinates or an IP address string to bias the results to favor locations near to the input location. |
worldview |
Returns features intended for different regional or cultural groups. The US ( |
output |
one of |
access_token |
The Mapbox access token (required); can be set with
|
coordinates |
The coordinates of a location in format |
Value
A character vector, list, or sf
object representing the query
results.
Examples
## Not run:
whitehouse <- mb_geocode("1600 Pennsylvania Ave, Washington DC")
## End(Not run)
## Not run:
mb_reverse_geocode(c(77.5958768, 12.9667046), limit = 5, types = "address")
## End(Not run)