This function returns isochrones from the Mapbox Navigation Service
Isochrone API. Isochrones are
shapes that represent the reachable area around one or more locations within
a given travel time. Isochrones can be computed for driving, walking, or
cycling routing profiles, and can optionally be set to return distances
rather than times.
mb_isochrone() returns isochrones as simple
features objects in the WGS 1984 geographic coordinate system.
mb_isochrone( location, profile = "driving", time = c(5, 10, 15), distance = NULL, depart_at = NULL, access_token = NULL, denoise = 1, generalize = NULL, geometry = "polygon", output = "sf", rate_limit = 300, keep_color_cols = FALSE, id_column = NULL )
A vector of form
c(longitude, latitude), an address that can be geocoded as a character string, or an
One of "driving", "walking", "cycling", or "driving-traffic". "driving" is the default.
A vector of isochrone contours, specified in minutes. Defaults to
c(5, 10, 15). The maximum time supported is 60 minutes. Reflects traffic conditions for the date and time at which the function is called. If reproducibility of isochrones is required, supply an argument to the
A vector of distance contours specified in meters. If supplied, will supercede
any call to the
time parameter as time and distance cannot be used
simultaneously. Defaults to
(optional) For the "driving" or "driving-traffic" profiles, the departure date and time to reflect historical traffic patterns. If "driving-traffic" is used, live traffic will be mixed in with historical traffic for dates/times near to the current time. Should be specified as an ISO 8601 date/time, e.g.
NULL (the default), isochrones will reflect traffic conditions at the date and time when the function is called.
A valid Mapbox access token.
A floating-point value between 0 and 1 used to remove smaller contours. 1 is the default and returns only the largest contour for an input time.
A value expressed in meters of the tolerance for the Douglas-Peucker generalization algorithm used to simplify the isochrone shapes. If
NULL (the default), the Mapbox API will choose an optimal value for you.
"polygon" (the default), which returns isochrones as polygons, or alternatively
"linestring", which returns isochrones as linestrings.
"sf" (the default), which returns an
sf object representing the isochrone(s), or
"list", which returns the GeoJSON response from the API as an R list.
The rate limit for the API, expressed in maximum number of calls per minute. For most users this will be 300 though this parameter can be modified based on your Mapbox plan. Used when
Whether or not to retain the color columns that the Mapbox API generates by default (applies when the output is an
sf object). Defaults to
If the input dataset is an
sf object, the column in your dataset you want to use as the isochrone ID. Otherwise, isochrone IDs will be identified by row index or position.
sf object representing the isochrone(s) around the location(s).