ox_isochrone: Compute isochrones (service areas)

View source: R/isochrone.R

ox_isochroneR Documentation

Compute isochrones (service areas)

Description

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.

Usage

ox_isochrone(g, center, cutoffs, weight = "length", ratio = 0.4)

Arguments

g

An osm_graph.

center

One or more origin node osmids (see ox_nearest_nodes()).

cutoffs

Numeric vector of cutoff values, in the units of weight.

weight

Edge column used as cost. Default "length".

ratio

Concavity for sf::st_concave_hull() (0 = most concave, 1 = convex). Default 0.4.

Details

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.

Value

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.

Examples

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

osmnxr documentation built on Oct. 20, 2026, 1:07 a.m.