You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this abstraction is not very helpful. So far there is only TurnCostExtension implementing it and the functionality is rather limited. In many (currently 6 in production and 26 in tests) cases we need to cast the extension to TurnCostExtension.
I can imagine all kinds of meta/additional data one likes to store for nodes/edges, but why would we use a GraphExtension for this ? Maybe we prefer a simple int[], use an independent DataAccess, fetch data from disk etc., this can easily be done by using the node/edge ids, I see no real advantage of storing the additionalNode/Edge field right in the graph and for example for TurnCostExtension we already use this field only to store a reference to another DataAccess.
Maybe I am missing something, but as far as I am concerned we can just keep the TurnCostExtension (without the interface) in BaseGraph (probably make it optional/can be null instead of using NoOpExtension).
Activity
karussell commentedon Oct 29, 2019
Yes, we should definitely do this! Maybe before this I have to make this branch production ready that allows storing arbitrary key value pairs like OSM tags or translated road names etc https://github.com/graphhopper/graphhopper/commits/string_index
Update: this would be also helpful for the branch move_tc_out_of_flag_encoder (#1775) and we could try if the following is possible:
edgeIteratorState.setTurnCost(carTurnCostEnc, nextEdgeId, 10.0)// base->adj->nextEdgeId[-]Remove the `GraphExtension` interface ?[/-][+]Remove the `GraphExtension` interface[/+]