Repository navigation
String index - #1784
String index#1784
Conversation
|
Looks good 👍 We could use this to store countrycodes per edge like i proposed it in #1709 |
|
Thanks! Works indeed surprisingly well.
In general this is more for the path extraction phase or for the MVT endpoint. It is not really suited for routing due to its design towards more compact size e.g. loops through all values of one edge. I'm sure for smaller areas it is still possible to do that, but this shouldn't be promoted in the core and should be done via EncodedValues instead. |
That's exactly my use case as I would like to add country information to the path details. The StringIndex would allow me to do this fairly cheap and i could avoid adding ~250 countries to the |
Have a look into this branch: https://github.com/graphhopper/graphhopper/tree/getall_prototype More a prototype (virtual edges won't work), but the rest seems to work fine and also for bigger areas: You can even misuse this to store the OSM ID ... highly inefficient but oh well... |
|
Thank you thank you thank you. |

This PR introduces a flexible storage to store key-value String pairs for every edge and will replace the NameIndex, so that we can store translated name tags ala name_ru, ref-tags separately or even arbitrary tags per edge. (It is basically a Map ala
Map<Long, Map<String, String>>except that you cannot define Long when you put it and get it returned when you add theMap<String, String>.)This PR only introduces the index, we still need a method like
edge.putExtra("key", "value")and we could also introduce a generic StringPathDetails and replace StreetNameDetails. Related also to #1772.The index has the following limitations:
32768-1unique keys (max length of each is 65k) and holds them in-memoryTODOs: