This works for me (`f` is a data.frame of X,Y origin locations,
`t` is a data.frame of X,Y destinations):
osrm_api <- function(f, t, key=NULL) {
url <-
"https://router.project-osrm.org/table/v1/driving/"
url <- paste0(url,
paste(f$X,
Hi,
We want to compute the distances between two matrices of points in (long,
lat)
This is how, as per the manual distance is calculated between two points:
route <- osrmRoute(src = com[1, c("comm_id", "lon","lat")],
dst = com[15, c("comm_id", "lon","lat")])
How would I compute the same for a