Error trying to expand the level of road in tile hierarchies #4304
Replies: 4 comments
-
Can you elaborate what your aim is here? The combo of your changes and Other than that, try out to increase it and see what happens. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the speedy reply!
There are several goals. Firstly we have routing for mopeds which needs to completely avoid motorways altogether, not just have them heavily penalised. Over long distances the routing essentially breaks (for example Berlin-Vienna is a route that triggered this, it gives you a crazy long route via Belgium when you completely exclude motorways) - presumably because over that sort of distance the number of transitions that are allowed between the hierarchies are exceeded, leaving the graph effectively disconnected at certain points because it can effectively only use primary/trunk roads and there are parts where the only link is secondary roads (if you don't use motorways). Including Secondary roads in level 0 fixes this problem. Second, we have routing for Motorcycles which optimises for a "fun" motorcycling experience. Mostly Motorcyclists are riding for leisure, and they prefer not to travel on motorways/trunk roads, preferring primary/secondary roads, and they care much less about overall journey speed. Here, we similarly want to include secondary roads at level 0, because otherwise the routing optimisation is effectively ignored over very long distances, again because of the limits in the number of times you can transition between hierarchies.
Yes, these changes roughly double the size of level 1 & 0 tiles (for the PBF files where this approach works), and the routing is correspondingly roughly twice as slow. However, this even when twice as slow this is an acceptable response time for us, and much, much faster than using the disable hierarchy pruning functionality altogether as in the bicycle routing.
Increasing it doesn't work - I tried bumping it to 2^26 from 2^25 and it spits out thousands of warnings like: GraphTileBuilder TileID: 2869 offset stored in directed edge: = 33554420 current ei offset= 948424112 Before eventually segfaulting. Any suggestions most welcome. Part of the problem here is just not really understanding what this edgeinfo offset is for, or what the implementation details of how the tiles are stored is - for example I don't understand why this would break in parts of asia but not in europe - so any sort of pointers/overview as to how that works would be really helpful. |
Beta Was this translation helpful? Give feedback.
-
Ah ok understood, thanks for elaborating. What you’re describing makes sense to me and I think your conclusions as to why it happens are valid. Another workaround would be to alter the hierarchy limits for transitions between level 0 & 1 or even trying to disable them. That will also decrease performance but not nearly as much as doing the same with level 2. It might end up being a similar perf as what you’re trying there. EdgeInfo is crucial for guidance, it contains the (var size) info about an edge that’s NOT needed for pure traversal, e.g. when forming the instructions and many other things. Just have a look at the edgeinfo header, seems you’re already knee deep in the code. I can’t tell you why it breaks in Asia, maybe tons more names for roads or or or.. |
Beta Was this translation helpful? Give feedback.
-
In any case, this isn’t an issue with the code, and rather a discussion topic, so I’ll transfer. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to expand the number of roads in each of the tile hierarchies in
src/baldr/tilehierarchy.cc
, addingsecondary
roads to level 0, andunclassified
roads to level 1. I'm developing routing which isn't optimising for fastest routes/main roads, but disabling the hierarchies altogether is too slow.Essentially I've just changed lines 14/19 in tilehierarchy.cc to look like:
and
This works fine on a PBF file containing European countries, but for a PBF file containing Japan, Taiwan etc. I run into the following error when it creates the shortcuts on level 0:
I'm struggling to understand how the code works in this area. Is it safe to just increase the value of
kMaxEdgeInfoOffset
? Or if not are there any other pointers you can give me?Beta Was this translation helpful? Give feedback.
All reactions