@danpat, Good evening. I mounted an osrm server for pan India where osrm-contract is taking around 6 hours which is fine as one time process .Now I would like to ingest live traffic speed in between; but that takes more than two hours for pan India which worthless to serve live traffic based routing. Please suggest how could we update traffic speed at 10 min intervals? Specifications are given below:-
=> OSRM version: V5.18.0
=> PBF size : ~500 MB
I am running following commands:
=> change in car.lua
=> Hardware
CPU: 8core
RAM: 32 GB
For live traffic use MLD algorithm in place of CH (osrm-routed --algorithm=MLD). Use osrm-partition and osrm-customize in place of osrm-contract.
https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM
Big thanks @frodrigo. It worked for me. there are couple of more question regrading traffic integration:
from_osm_id,to_osm_id,edge_speed_in_km_h(,edge_rate?,(anything else)?)?
can you explain more about edge_rate with example.
according to document if edge_rate is not supplied then the edge speed in meters per second will be used to update edge weight (corresponds to the "duration" weight). I have speed in km/h
how could supply the edge speed in km/h?. if i do use the speed in m/s then it is not accurate(after conversion loss of fractional values since it doesn't take float values)
Refer: https://github.com/Project-OSRM/osrm-backend/wiki/Traffic
how it it be possible for osrm to provide the route according to: default speed OR with traffic speed without using multiple instances of osrm-route?
so there should be a new parameter like use_traffic=true to use the traffic speed other wise use the default speed.
http://router.project-osrm.org/route/v1/driving/polyline(ofp_Ik_vpAilAyu@te@g%60E)?use_traffic=true
since we have traffic based speed available how can we enable the congestion via annotations parameter?. e.g annotations=congestion,speed
I am waiting for your reply....
@Vishwajit1986
edge rate allows you to set a graph weight different to travel speed. For example, you can set the edge-rate to 1.0, but set the speed to the regular value, and you will get distance based routing, but with correct ETAs. OSRM separates the concept of the value used for route selection, and the value used to calculate the ETA of the selected route. You can use this, for example, to bias away from certain roads, but still return a reasonable ETA if those roads must be used.
OSRM cannot currently do this - there is only 1 optimized routing graph, and the structure of the graph cannot be changed at runtime. What you suggest (default speed or traffic speed) would require two optimized routing graphs, which is basically what running two instances of OSRM does.
In order to calculate congestion, you need both the "freeflow" speed and the "current speed" - OSRM only stores the "current speed", so it's not possible to calculate the relative congestion using internal data.
I am waiting for your reply....
Please note that this is an open source project, and you asked your question on a Friday. Please allow some time for a reply.
a work around for 3 might be to run a separate osrm process just for returning the freeflow speeds?
@danpat thanks a lot!
if i do convert the speed into m/s then it will become
84108559;84192229;12.5
84108772;84192155;10.2777777777778
84108906;84108885;2.5
84108911;84343247;4.72222222222222
osrm-customize throwing error. if i do remove the fractional part the ETAs will be not become correct but osrm-customize accepting .
could you explain how to use km/h speed to ingest to get correct ETAs?
2 and 3 => In both, require two optimized routing graphs. that can solve problem and open the other feature using the single instance of osrm.Any future plan to do same? let me know if start the work on this i love to share many more feature depend on this and be the part of that enhancements.
@Vishwajit1986 The speed column in the CSV file is supposed to be in km/h, you do not need to convert it to m/s. See the documentation here:
https://github.com/Project-OSRM/osrm-backend/wiki/Traffic
Note that you also need to use commas ,, not semicolons ; as the CSV separator.
There are no current plans to work on (2) and (3).
Closing here - no next actions.
Most helpful comment
For live traffic use MLD algorithm in place of CH (
osrm-routed --algorithm=MLD). Useosrm-partitionandosrm-customizein place ofosrm-contract.https://github.com/Project-OSRM/osrm-backend/wiki/Running-OSRM