Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.29k stars 3.32k forks source link

osrm-datastore-route #5420

Closed godali645 closed 1 month ago

godali645 commented 5 years ago

Hi I want update osrm-routing with live traffic data every 30 sec. so i build traffic.csv then ./osrm-extract file.osm -p car.lua --generate-edge-lookup ./osrm-partition file.osrm ./osrm-customize file.osrm --segment-speed-file traffic.csv ./osrm-datastore file.osrm ./osrm-routed -a MLD -> (-s defualt 1 so it shared memory)

After 30 seconds I change my traffic file to new data in traffic.csv then run ./osrm-datastore file.osrm

and make query to http so the route did not change. why? i should stop ./osrm-routed and re-run ./osrm-routed?

my traffic.csv example: 2021343025,2316962626,80

after 30 seconds: 2021343025,2316962626,40

thx

unibasil commented 5 years ago

why? i should stop ./osrm-routed and re-run ./osrm-routed?

Seems to my experience, yes. Or you can write your own osrm-routed server using NodeJS OSRM module.

danpat commented 5 years ago

@godali645 Are you re-running osrm-customize with your new traffic.csv file?

Here's how it should function:

# Initial generation of the routing graph, and starting up the osrm-routed server
./osrm-extract -p profiles/car.lua file.osm.pbf
./osrm-partition file.osrm
fetch-latest-traffic-somehow > traffic.csv
./osrm-customize --segment-speed-file traffic.csv file.osrm
./osrm-datastore file.osrm
./osrm-routed -a MLD -s &

# Ongoing traffic updates
while /bin/true ; do
  sleep 30
  fetch-latest-traffic-somehow > traffic.csv
  ./osrm-customize --segment-speed-file traffic.csv file.osrm
  ./osrm-datastore file.osrm
done

There is no need to restart osrm-routed when running in shared memory mode.

github-actions[bot] commented 2 months ago

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