Uses an OSRM (open source routing machine) instance to compute distance measures between source geometry and destination geometry. Measures available are those enabled by the OSRM API service: walking, driving and cycling. These measures are available in the following metrics: duration (in minutes) and distance (in meters).

duration_by_foot(src, dst)

distance_by_foot(src, dst)

duration_by_car(src, dst)

distance_by_car(src, dst)

duration_by_bike(src, dst)

distance_by_bike(src, dst)

osrm_distance(src, dst, profile)

osrm_duration(src, dst, profile)

Arguments

src

sfc object with the source points.

dst

sfc object with the destination points.

profile

character str object indicating the OSRM profile needed.

Value

matrix Matrix with measures (distances or durations) from src (rows) to dst (cols).

See also