Description Usage Arguments Details Value Examples
An isochrone, also known as a service area, is a polygon that shows the area reachable from a starting point by traveling along a road network for a certain distance or time. This function provides an interface to the Valhalla routing engine's isochrone API. It lets you provide a starting point's latitude and longitude, a distance or time metric, and a vector of distances/times, and if it's successful it returns an sf-class tibble of polygons.
1 2 3 4 5 6 7 8 9 10 |
from |
A tibble containing one origin location in columns named |
costing |
The travel costing method: at present "auto", "bicycle", and "pedestrian" are supported. |
contours |
A numeric vector of values at which to produce the isochrones. |
metric |
Distance or time. Accepts parameters "min" and "km". |
min_road_class |
The minimum road classification Valhalla will consider. Defaults to |
minimum_reachability |
The minimum number of nodes a candidate network needs to have before it is included. |
hostname |
Hostname or IP address of your Valhalla instance. Defaults to "localhost". |
port |
The port your Valhalla instance is monitoring. Defaults to 8002. |
More more information, please see Valhalla's API documentation:
An sf/tibble object containing isochrone polygons.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
library(valhallr)
# set up our departure point: the University of Ottawa
from <- test_data("uottawa")
# generate a set of isochrones for travel by bicycle
i <- valhallr::isochrone(from, costing = "bicycle")
# map the isochrones
map_isochrone(i)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.