Haves
Haves

Reputation: 152

Graphhopper Server - Create and use a custom vehicle type

While browsing https://github.com/graphhopper/directions-api/blob/master/docs-routing.md I found the option to choose one of the preset vehicle types car, foot and bike. But unfortunately I have to calculate the duration based on vehicles with caped maximum speed (slower than a car and faster than a bike) which are also not allowed to drive on interstates.

What is the best approach to make something like this work?

Upvotes: 3

Views: 1533

Answers (1)

Karussell
Karussell

Reputation: 17375

You can use an existing standard profile like car and reduce the speed profile and adjust the allowed highway tags. E.g. look into the CarFlagEncoder. Another (currently more complex) solution is to write a custom FlagEncoder from scratch.

Upvotes: 3

Related Questions