Split an edge into several segments in traffic.tar?
Closed this issue · 2 comments
First of all I need to thank this project for showing a clear path on the traffic thing.
I've been tweaking the code of this POC to make it towards a production approach. One question I can't figure out alone is: since TrafficSpeed
contains 2 breakpoints fields to specify the portion that the speed should apply to on an edge, how can I split an edge into several segments and apply different traffic speed within traffic.tar
?
Let me elaborate on the scenario with an example. Supposing I have a good data source telling me that segment 1 has an accident causing the traffic flow into a stasis, while eventually going into segment 2 you'll have a normal speed. This could happen in many real-time traffic use cases when we try to reflect the traffic accurately in the routing engine. Here's a graph illustrating this:
|------------------ edge A -------------------|
| segment 1 | segment 2 |
| speed: 12 | speed: 60 |
The functions build_live_traffic_data
and customize_live_traffic_data
have demonstrated writing as many edges as tile.header->directed_edge_count
to the archive, but without specifying an edge ID. Based on the scenario above, is it possible to take both speeds for segment 1 and 2 in effect?
Hello,
Yep, that's a valid follow up to get something useful out of this project. It's definitely doable, but I'm afraid I never got to use this 100% in production, so I can't tell you how to model actual traffic data.
Your best bet for info on this would be the Valhalla discussions on the Github repo: https://github.com/valhalla/valhalla/discussions
Thank you Alin. Let me put the question on Valhalla discussion board.