R/osrmfunctions.R
table2matrix.RdReturn Matrix containing travel times between origins and destinations
table2matrix(lat, lng, destlat = NA, destlng = NA, api = 5, profile = "driving", protocol = "v1", osrmurl = "http://router.project-osrm.org")
| lat | Numeric vector containing latitude coordinate for each coordinate to calculate travel times. Also accepts dataframe with latitude in the first column and longitude in the second column. |
|---|---|
| lng | Numeric vector containing longitude coordinate for each coordinate to calculate travel times. |
| destlat | Numeric vector containing destination latitude coordinate for each coordinate to calculate travel times. Also accepts dataframe with latitude in the first column and longitude in the second column. Default is value of lat. |
| destlng | Numeric vector containing longitude coordinate for each destination coordinate to calculate travel times. Default is value of lng. |
| api | An integer value containing the OSRM API version (either 4 or 5). Default is 5. |
| profile | OSRM profile to use (for API v5), defaults to "driving". |
| protocol | The protocol to use for the API (for v5), defaults to "v1". |
| osrmurl | Base URL of the OSRM service |
Return a matrix containing travel times between origins and destinations
# NOT RUN { table2matrix(seq(from = 50, to = 52, by = 0.1), seq(from = 12, to = 14, by = 0.1)) # }