| ox_isochrone | R Documentation |
For one or more origin nodes, finds the set of nodes reachable within each
cutoff (by the chosen edge weight — distance or, with
ox_add_edge_travel_times(), travel time) and returns a polygon per cutoff:
the hull of the reachable nodes. With several origins, reachability is the
minimum cost from any origin.
ox_isochrone(g, center, cutoffs, weight = "length", ratio = 0.4)
g |
An osm_graph. |
center |
One or more origin node |
cutoffs |
Numeric vector of cutoff values, in the units of |
weight |
Edge column used as cost. Default |
ratio |
Concavity for |
Reachable sets come from the Rust Dijkstra core; the hull is built with
sf::st_concave_hull() when available (GEOS >= 3.11), falling back to a
convex hull. For metric cutoffs, project the graph to a metric CRS first.
An sf object with one polygon row per cutoff (columns cutoff,
n_nodes, geometry), ordered from largest to smallest cutoff so smaller
areas draw on top.
g <- example_osm_graph(n = 6, spacing = 100)
center <- ox_nearest_nodes(g, 250, 250)
iso <- ox_isochrone(g, center, cutoffs = c(100, 300))
iso
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.