osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

[question, bug?] Traffic - how does segment-speed-file really work?

Open mbukovy opened this issue 8 years ago • 6 comments

Hello,

I'm using OSRM with traffic and everything worked well. Until I realized, that customize resets my graph...? Situation:

  1. Let's have a map of Europe in OSRM.
  2. Start osrm (osrm-routed with mld algorithm and shared memory)
  3. Run osrm-customize with first 500 node pairs (1st rates update)
  4. Run osrm-datastore to actually update OSRM

Now routing respects the first update. Let's continue

  1. Run osrm-customize with next 800 node pairs (2nd rates update)
  2. Run osrm-datastore to actually update OSRM

Now it respects the second update, but the first one is gone? And this is my question - does it really work this way? Or am I doing something wrong? Does this mean, I must always provide valid updates for whole europe, not just new ones? So in my example, I must provide all 1300 node pairs for second update?

I use version 5.18.0.

Thanks! Michal

mbukovy avatar Jun 22 '18 14:06 mbukovy

@mbukovy osrm-customize updates the datafiles in-place. So the edges updated in your first osrm-customize should be retained.

This is not always desirable, but it sounds like it's what you want, and it should be the default behaviour.

danpat avatar Jun 22 '18 14:06 danpat

Yes, that's what I want, but that's not how it works for me. I've tested it and it actually clears my previous updates. What could be wrong? @danpat

mbukovy avatar Jun 22 '18 14:06 mbukovy

I've downgraded to 5.17 but still the same. This is my workflow, please tell me, I do something wrong / or is it a bug in OSRM? I use Czech republic map for my tests (I'll do the whole Europe for production)

  1. osrm-extract czech-republic-latest.osm.pbf -p ../osrm-backend-5.17.0/profiles/car.lua --generate-edge-lookup
  2. osrm-partition czech-republic-latest.osrm
  3. osrm-customize czech-republic-latest.osrm
  4. osrm-datastore czech-republic-latest.osrm
  5. osrm-routed -s 1 --algorithm=MLD -p 5001

Then I've prepared two test csv files: danger1.csv is a way segment here https://www.openstreetmap.org/node/1139503559 danger2.csv is a way segment here https://www.openstreetmap.org/node/60271726

danger1.csv

1139503559,176916175,0
176916175,1139503559,0
176916174,1139503559,0
1139503559,176916174,0
1139554452,176916174,0
176916174,1139554452,0
176916173,1139554452,0
1139554452,176916173,0
1139554848,176916173,0
176916173,1139554848,0
176916172,1139554848,0
1139554848,176916172,0
176916171,176916172,0
176916172,176916171,0
1139554909,176916171,0
176916171,1139554909,0
176916170,1139554909,0
1139554909,176916170,0
1139554430,176916170,0
176916170,1139554430,0
176916169,1139554430,0
1139554430,176916169,0
246636954,176916169,0
176916169,246636954,0
176916167,246636954,0
246636954,176916167,0

danger2.csv

60271726,60271727,0
60271727,60271726,0
60271727,622152853,0
622152853,60271727,0
622152853,60271728,0
60271728,622152853,0
60271728,3937617060,0
3937617060,60271728,0
3937617060,1320864485,0
1320864485,3937617060,0
1320864485,3269268977,0
3269268977,1320864485,0
3269268977,3269268976,0
3269268976,3269268977,0
3269268976,60271750,0
60271750,3269268976,0
60271750,622152844,0
622152844,60271750,0
622152844,245503029,0
245503029,622152844,0
245503029,267572530,0
267572530,245503029,0
267572530,1323305076,0
1323305076,267572530,0

Now i do 6. osrm-customize czech-republic-latest.osrm --segment-speed-file testrates/danger1.csv 7. osrm-datastore czech-republic-latest.osrm --only-metric

danger1 is working now, routing avoids that way.

Next: 8. osrm-customize czech-republic-latest.osrm --segment-speed-file testrates/danger2.csv 9. osrm-datastore czech-republic-latest.osrm --only-metric

danger2 is working now, but danger1 is not preserved and routing is using this way once again.

  1. osrm-customize czech-republic-latest.osrm --segment-speed-file testrates/danger1.csv
  2. osrm-datastore czech-republic-latest.osrm --only-metric

danger1 is working again, but danger2 is not preserved and routing is using this way once again.

mbukovy avatar Jun 25 '18 09:06 mbukovy

You can specify two data files, as listed in the Wiki here: https://github.com/Project-OSRM/osrm-backend/wiki/Traffic#multiple-data-files

Give this a try!

JasonCromer avatar Feb 05 '19 01:02 JasonCromer

@mbukovy I'm seeing the same thing with version 5.22.0 on Mac. Although the route now doesn't avoid the first csv route, those segments do reflect the modified speed.

Original: Screen Shot 2019-08-06 at 2 18 48 PM

First customize (speed set to zero between Archdale and Hayman): Screen Shot 2019-08-06 at 2 19 05 PM

Second customize (speed set to zero between Aycock and Walker... notice the time): Screen Shot 2019-08-06 at 2 19 18 PM

rdvelazquez avatar Aug 06 '19 18:08 rdvelazquez

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.

github-actions[bot] avatar Jul 08 '24 21:07 github-actions[bot]