Description Usage Arguments Value Examples
View source: R/make_isodistance.R
Generates an isodistance polygon for network distances to/from a specified location.
1 2 3 4 5 6 7 8 9 10 11 | make_isodistance(
site,
distance,
direction = c("out", "in"),
detail = "medium",
mode = c("driving", "walking", "cycling", "transit"),
departing = FALSE,
tz = Sys.timezone(),
init_grid_size = 5,
google_api_key = Sys.getenv("google_api_key")
)
|
site |
either a data.frame with the columns 'lat' and 'lng' or a character string to be geocoded. |
distance |
a numeric value in meters. This is the network distance from the site to the isodistance extents. |
direction |
either 'in' or 'out'. In generates an isodistance from multiple origins to the site. Out goes from the site to multiple destinations. |
detail |
'low', 'medium' or 'high' level of detail in the isodistance. High will produce the most granular detail but will use more API credits. |
mode |
a character string for the mode of travel. Possible values are 'driving', 'cycling', 'transit', or 'walking' |
departing |
optional parameter for getting distance in traffic. Google maps may route differently to avoid heavy traffic, changing the distance at peak times. If set, takes the format "YYYY-MM-DD HH:MM:SS" in the local time of the origin country. |
tz |
if departure time is set, timezone defaults to the user's timezone as per 'Sys.timezone'. Where the timezone of the 'site' differs from the user timezone, specify the 'site' timezone here. tz is a character string that must be a time zone that is recognized by the user's OS. |
init_grid_size |
an integer from 2 to 5. Adjust if want to change number of points to pick up in the initial guess stage before adding detail. |
google_api_key |
the google maps API key. This can be generated from the google cloud console and set with set_google_api |
an sf polygon
1 | walk_radius <- make_isodistance('EC2R 8AH', distance = 2000, direction = 'out', mode = 'walking')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.