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

Updating OSM data in OSRM backend

Open ayrus96 opened this issue 2 years ago • 3 comments

Hi, I have installed OSRM using docker and it works fine. The problem I am facing is how to update the large set of osm data frequently. Because while performing osrm-extract and osrm-contract. It took more time to finish the preprocessing. If i want to update the data with same instance as geofabrik updated their data (data are updated daily). How can i solve this. because downloading GB size file daily and do the preprocessing steps every time is not a good idea. So is there any solution for data version controlling like that? If yes, please guide me with an URL or something

ayrus96 avatar Jun 21 '22 10:06 ayrus96

no URL, but if you keep digging you'll find tons of hints.

if you want to build a new graph with updated data, you'll have to go through the entire osrm processing chain, even if you just add a single street to your graph. that's true for almost every routing engine (and if it's not true you can be sure it'll be a damn slow routing engine).

the best way to keep your osm files up-to-date is not downloading a new file every day, but rather apply incremental daily updates. look at osmium and its python package, there you'll find easy executables to update osm files.

nilsnolde avatar Jun 21 '22 11:06 nilsnolde

Hi @nilsnolde I'd be grateful if you could please extend you answer.

I'm now going the entire chain every 15 days, and I'd like to update the database every night, downloading the updates. I've checked osmium but I didn't find any clue.

Thanks!

driade avatar Sep 15 '23 09:09 driade

https://docs.osmcode.org/pyosmium/latest/tools_uptodate.html

you'll have to find an update server which provides daily diffs, e.g. geofabrik has those for each of their regions. maybe there's some planet-wide daily diff server as well somewhere.

I had some more special requirements over the years:

  • https://gist.github.com/nilsnolde/659eab65c9deb449b019458712e1f21b
  • https://gist.github.com/nilsnolde/ec0af101fd522998b0d559781a2752e4

nilsnolde avatar Sep 15 '23 09:09 nilsnolde