Consider specific Node tags for routing

Hey there developers!

I’m pretty new to the GraphHopper Code. So please bare with me. I have setup the complete environment and this works. Also I’ve added my own FlagEncoder. Now I want to change the routing code.
I have the following problem: I want to introduce a new parameter to the Routing API endpoint (module graphhopper-api), where I can set e.g. maxwidth of the vehicle. This information should be used (I guess) in the core (module graphhopper-core) to consider it when calculating the route. Currently GraphHopper only considers maxwidth of ways (as I know). I want to extend the functionality to also consider nodes which contain width information. So my question is: Where to start? Is there a main starting point where in the code I can implement this at first, maybe hardcoded width of the vehicle without the api in the first place?

My plan was currently: I need to add the tags on nodes I want, to the FlagEncoder analog to potentialBarriers (like in BikeCommonFlagEncoder) with the width information. Then the information is in the Graph. Can I save this information via a HashMap for example and how?
For parsing I could use the OSMMaxWidthParser, I guess.
And now , how to consider it when routing is executed? Where to hook on?

I would be very grateful for help!
Thank you and Regards.

Tags for nodes are unfortunately not easy to support right now and you would need to dig deep in OSMReader to make this working. It is not impossible and we hope to make this easier in one of the next releases after 3.x

1 Like

See this branch (last 3 commits from February) if you want a half solution as indication in which direction this can go: https://github.com/graphhopper/graphhopper/commits/node_parser_extraction

Alright thank you very much, I’ll look into that and estimate if I am capable of integrating this feature :slight_smile: