routing icon indicating copy to clipboard operation
routing copied to clipboard

Merge two RouterDb objects

Open YuriiNskyi opened this issue 4 years ago • 4 comments

Are there any ways to merge two RouterDb objects?

For example, I have RouterDb with multiple streets inside, and want to add a new street without recalculating all RouterDb. Or, recalculate existing street into new RouterDb and merge these two databases. There are a lot of situations, where recalculating part of RouterDb would be useful.

YuriiNskyi avatar Oct 23 '19 10:10 YuriiNskyi

https://wiki.openstreetmap.org/wiki/Osmosis

https://wiki.openstreetmap.org/wiki/Osmconvert

wmpoolt avatar Oct 28 '19 15:10 wmpoolt

I think @YuriiNskyi means specifically routerdb files, how can he concatenate or update them.

And I think @wmpoolt is suggesting you perform the conversion and combination in the osm format before you build your RouterDb.

Even if you could update the routerDb you would still need to parse the OSM to obtain the updates so it's kinda of a chicken and egg situation.

It's not that useful to update the routerDb when you can easily generate a new one after loading the OSM data although I might be missing edge cases.

juliusfriedman avatar Feb 29 '20 00:02 juliusfriedman

@juliusfriedman you are totally right, I meant specifically RouterDb files.

By manipulating with multiple RouterDb files, I thought I can solve traffic jams problem, something like updating RouterDb with another RouterDb with actual traffic information. This question is very similar to adding traffic information to RouterDb.

YuriiNskyi avatar Mar 04 '20 10:03 YuriiNskyi

This is not supported out of the box with Itinero but it is probably doable to write some custom code that can handle this. Depends what type of data you are 'merging' obv.

It is possible to for example keep nodeids from OSM as meta data in the routerdb. If you do that it should be possible to match vertices together and merge them. The only issue you will most likely have at the edge of the network is that nodes that are not intersections are not converted to vertices. This could lead to a situation where you have two routerdb with a node used in one but dropped in another.

xivk avatar Mar 04 '20 10:03 xivk