Build and send OSRM API queries to get travel time matrices between points. This function interfaces the table OSRM service.

osrm_table(
  src = NULL,
  dst = NULL,
  measure = "duration",
  osrm_profile = "driving",
  osrm_server = getOption("osrm.server")
)

Arguments

src

a data frame containing origin points identifiers, longitudes and latitudes (WGS84). It can also be a SpatialPointsDataFrame, a SpatialPolygonsDataFrame or an sf object. If so, row names are used as identifiers. If dst and src parameters are used, only pairs between scr/dst are computed.

dst

a data frame containing destination points identifiers, longitudes and latitudes (WGS84). It can also be a SpatialPointsDataFrame a SpatialPolygonsDataFrame or an sf object. If so, row names are used as identifiers.

measure

a character indicating what measures are calculated. It can be "duration" (in minutes), "distance" (meters), or both c('duration', 'distance'). The demo server only allows "duration".

osrm_profile

the routing profile to use, e.g. "car", "bike" or "foot" (when using the routing.openstreetmap.de test server). getOption("osrm.profile") by default.

osrm_server

the base URL of the routing server. getOption("osrm.server") by default.

Value

A list containing 3 data frames is returned. durations is the matrix of travel times (in minutes), sources and destinations are the coordinates of the origin and destination points actually used to compute the travel times (WGS84).

See also

set_server_profile and utils for helper functions used in this function