Closed karpinskiJ closed 1 month ago
Probably helps to get a look at the geometries to reason about this. You can have those included on the response using the "shape_format" parameter. It's entirely possible that there's e.g. a one way somewhere that forces a big detour
I used parameter you mentioned, but I didn't get the shape (I guess that nearest pois were returned): Request:
{
"costing": "auto",
"format":"osrm",
"shape_format":"geojson",
"targets": [
{
"lat": -4.9081,
"lon": -80.6929
}
],
"sources": [
{
"lat": -4.89552 ,
"lon": -80.67223
}
]
}
Response:
{
"costing": "auto",
"format":"osrm",
"shape_format":"geojson",
"targets": [
{
"lat": -4.9081,
"lon": -80.6929
}
],
"sources": [
{
"lat": -4.89552 ,
"lon": -80.67223
}
]
}
Is there some parameter which I missed? I tried with turn by turn endpoint as well, but results there are not different when direction is changed.
you need to remove the format=osrm
param
Hello! I resolved issue by changing source_to_target_algorithm to timedistancematrix variable in valhalla.json file.
I tried to find documentation referring to difference between costamtarix and timedistancematrix alghorithms, but I couldn't find any? @chrstnbwnkl Could you please link some sources or let me know what is the difference? Thank you in advance!
I can't reproduce your first result on the public Valhalla instance (which is not too different from a default Docker setup in terms of config). Would be helpful to see your valhalla config.
TimeDistanceMatrix uses a unidirectional Dijkstra algorithm, while CostMatrix uses bidirectional AStar, which is faster but can sometimes not guarantee the optimal path, and is suboptimal for time dependent requests.
My config for thor requests:
"thor": {
"clear_reserved_memory": false,
"extended_search": false,
"logging": {
"color": true,
"file_name": "path_to_some_file.log",
"long_request": 110.0,
"type": "std_out"
},
"max_reserved_labels_count_astar": 2000000,
"max_reserved_labels_count_bidir_astar": 1000000,
"max_reserved_labels_count_bidir_dijkstras": 2000000,
"max_reserved_labels_count_dijkstras": 4000000,
"service": {
"proxy": "ipc:///tmp/thor"
},
"source_to_target_algorithm": "select_optimal" # I changed this one to timedistancematrix
}
Closing here, it's definitely upstream related.
Hello! I'm sending sources_to_targets request to obtain travel_time & disctance between 2 points located in Peru.
Request input body:
Results which I obtained are (travel time and distance make no sense - checked in google maps ):
but when I change direction results are reliable:
Do you have any idea what might be a reason? My only thought is that it's something regarding maps or land form, but area in nearby seems to be quite flat. There is also output from openstreetmap: https://www.openstreetmap.org/directions?engine=fossgis_valhalla_car&route=-12.066%2C-75.212%3B-12.062%2C-75.187#map=16/-12.06438/-75.20041