Waterways path possible?


I am new to Graphhopper. I would like to use it for determining routes over networks of waterways. Is this possible out of the box? What would be needed to implement this?

It is not possible out of the box. But you can easily create a new FlagEncoder e.g. look at the CarFlagEncoder and accept certain highways and define certain speeds per highway type etc. Also there is documentation about this topic here

Thanks for the swift reply. If I understand correctly, I should create a ShipFlagEncoder and accept a “canal” and “river” etc. as a highway type, and prevent any routing over land. Is that correct?

Yes, this is correct. Also you define if certain ways are oneways and what the assumed speed should be for every type. On the lower level side you define how many bits you use for the speed, see the bike encoders for more fine grained speed values which is probably more what you need for ships.

Normally the AbstractFlagEncoder is extended but in your case you e.g. do not need roundabouts, ferries or fords. But you can just ignore this and it can still act as a better starting point compared to implementing the FlagEncoder interface from scratch.

Thanks, will give it a try.

Hello, can you explain more, what should I do if I need waterways path, which variable or methods should I override or modify. Any help would be greatly appreciated!