ox_distances: Single-source shortest distances

View source: R/routing.R

ox_distancesR Documentation

Single-source shortest distances

Description

Minimum-weight distance from from to every node in the graph.

Usage

ox_distances(g, from, weight = "length")

Arguments

g

An osm_graph.

from

A node osmid.

weight

Edge column used as weight. Default "length".

Value

A tibble with columns osmid and distance (Inf for unreachable nodes).

Examples

g <- example_osm_graph()
ox_distances(g, ox_nearest_nodes(g, 0, 0))

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