
Last chance! 50% off unlimited learning
Sale ends in
Last chance! 50% off unlimited learning
Sale ends in
Geocode addresses or locations in bulk using the Mapbox Batch Geocoding API
mb_batch_geocode(
data,
search_column = NULL,
address_line1 = NULL,
address_number = NULL,
street = NULL,
block = NULL,
place = NULL,
region = NULL,
postcode = NULL,
locality = NULL,
neighborhood = NULL,
country = NULL,
permanent = FALSE,
limit = 1,
search_within = NULL,
language = NULL,
types = NULL,
proximity = NULL,
worldview = NULL,
allow_large_job = FALSE,
access_token = NULL,
sf = TRUE
)
The input dataset as an sf POINT object representing the geocoded locations, or the input dataset with longitude, latitude, and matched address columns included.
An input data frame
A column that contains a description of the place to geocode, or a full address. search_column
cannot be used with address component arguments.
The name of a column in data
that contains the first line of an address, e.g. "1600 Pennsylvania Ave NW"
The name of a column in data
that contains the address number, e.g. "1600". Not required when address_line1
is used.
The name of a column in data
that contains the street name, e.g. "Pennsylvania Ave NW". Not required when address_line1
is used.
The name of a column in data
that describes the block, used in some Japanese addresses.
The name of a column in data
that contains the place name; typically a city, village, or municipality, e.g. "Washington"
The name of a column in data
that represents sub-national administrative features, such as states in Mexico or the United States. Example: "DC"
The name of a column in data
representing the postal code of the address; this will be a ZIP code in the United States, e.g. "20500"
The name of a column in data
that describes official sub-city locations, such as arrondissements in France.
The name of a column in data
that represents a colloquial neighborhood name for the location.
A character string or vector of ISO 3166 alpha-2 country codes within which you would like to limit your search.
Either FALSE (the default) when results are not intended to be stored, or TRUE if the results are planned to be stored.
How many results to return per address. This is not currently accessible for users and can only be 1.
An sf
object, or vector representing a bounding box of
format c(min_longitude, min_latitude, max_longitude, max_latitude)
used
to limit search results. Defaults to NULL.
The user's language, which can help with interpretation of queries. Available languages are found at https://docs.mapbox.com/api/search/#language-coverage.
A vector of feature types to limit to which the search should be
limited. Available options include 'country'
, 'region'
, 'postcode'
,
'district'
, 'place'
, 'locality'
, 'neighborhood'
, 'address'
, street
, block
, address
. and 'secondary_address'
. If left blank, all types will be searched.
proximity Either a vector of coordinates or an IP address string to bias the results to favor locations near to the input location.
Returns features intended for different regional or cultural groups. The US ('us'
) world view is returned by default.
A boolean indicating that the user is OK with potential charges incurred to their account due to a large geocoding job (over 1000 addresses). The Mapbox Free Tier includes 100,000 free geocodes per month. Defaults to FALSE
.
The Mapbox access token (required); can be set with
mb_access_token()
A boolean that determines whether the output will be an sf POINT object (TRUE
, the default) or a regular data frame (FALSE
).