Osrm-backend: does live traffic speed update at 10 min intervals?

Created on 5 Jun 2018  路  9Comments  路  Source: Project-OSRM/osrm-backend

@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:

  1. osrm-extract india.bbf 鈥損 car.lua --generate-edge-lookup
  2. osrm-contract india.osrm --segment-speed-file update.csv 鈥揷ore1.0
  3. osrm-routed india.osrm
    update.csv(contains around 500,000 records)

=> change in car.lua

  1. left_hand_driving = true,
  2. avoid = Set {
    'area',
    'toll', -- uncomment this to avoid tolls
    'reversible',
    'impassable',
    'hov_lanes',
    'steps',
    'construction',
    'proposed'
    },

=> Hardware
CPU: 8core
RAM: 32 GB

Most helpful comment

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

All 9 comments

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:

  1. 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

  2. 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

  3. 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

  1. 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.

  2. 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.

  3. 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?

1342 would also be a way to do it (but it's not implemented)

@danpat thanks a lot!

  1. Good explanation about edge-rate.Need more clarification to ingest traffic speed .
    I have speed into km/h
    e.g
    84108559;84192229;45
    84108772;84192155;37
    84108906;84108885;9
    84108911;84343247;17

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Eichenherz picture Eichenherz  路  4Comments

Oyabi picture Oyabi  路  5Comments

ardanika picture ardanika  路  3Comments

JamesLawrenceGSI picture JamesLawrenceGSI  路  3Comments

Bardo-Konrad picture Bardo-Konrad  路  3Comments