Hi Everybody,
I have a problem with osrmTable from osrm package,
I did an example with 3 data frame (3 latitude/longitude from 3 city in France : Paris, Rennes and Quimper)
dfPQ :
|Id|lon|lat|
|QUIMPER|-4.09111944455|47.9971425162|
|PARIS 01|2.33629344655|48.8626304852|
dfPR :
|Id|lon|lat|
|RENNES|-1.68186449144|48.1119791219|
|PARIS 01|2.33629344655|48.8626304852|
dfPRQ :
|Id|lon|lat|
|RENNES|-1.68186449144|48.1119791219|
|QUIMPER|-4.09111944455|47.9971425162|
|PARIS 01|2.33629344655|48.8626304852|
I used osrmTable :
distPR <- osrmTable(loc = dfPR, measure = 'duration')
distPR$durations
RENNES PARIS 01
RENNES 0.0 226.5
PARIS 01 226.8 0.0
distPQ <- osrmTable(loc = dfPQ, measure = 'duration')
distPQ$durations
QUIMPER PARIS 01
QUIMPER 0.0 226.5
PARIS 01 226.8 0.0
distPRQ <- osrmTable(loc = dfPRQ, measure = 'duration')
distPRQ$durations
RENNES QUIMPER PARIS 01
RENNES 0.0 NA 384
QUIMPER NA 0 NA
PARIS 01 385.4 NA 0
I don’t understand:
- Why distance between Paris and Rennes is the same time than between Paris and Quimper (Because Paris-Rennes is 150 minutes shorter than Paris-Quimper)
- Why I have difference between the first run (Paris-Rennes = 226,8 min) and the third (Paris-Rennes = 385,4 min)
- Why I have difference between the second run (Paris-Quimper = 226,8 min) and the third (Paris-Quimper = NA)
I’m looking for distance by car between 2 cities (with their longitude and latitude)
Thanks for your help,
K.