Hi,
I’m using GraphHopper to generate motorcycle round trips and struggling with two different approaches:
Approach 1: Using algorithm=round_trip
- Works well for generating loops
- Problem: Can’t control direction - the heading parameter seems to be ignored
- In my tests, all headings (0°, 90°, 180°, 270°) produce the exact same route
- Changing round_trip.seed creates different routes, but direction is still random
Approach 2: Using waypoints (Start → P1 → P2 → P3 → Start)
- I calculate 3 waypoints on a circle around start (e.g. east, northeast, southeast)
- Use normal routing between waypoints
- Problem: Routes often use the same road back and forth (e.g. Start → P1 on Road A, then P1 → P2 also uses Road A in reverse)
- I tried use_headings=true with heading_penalty=120 and pass_through=true, but alternatives still share too much with the main route
Question:
Is there a way to either:
- Make algorithm=round_trip respect the heading parameter?
- Prevent the waypoint approach from using the same edges in both directions?
I’ve tried the alternative_route algorithm with max_share_factor=0.4, but that only works with 2 points, not for multi-waypoint round trips.
Any suggestions would be greatly appreciated!
Thanks!