I’m using GH 3.0 as the basis for my application, which helps runners discover new running routes.
One issue I’ve noticed is that routes can be quite complex to follow whilst running, because they include lots of junctions. Often there is a slightly longer route that includes fewer junctions, which would be much easier to follow.
Is there any existing way to assign a penalty to junctions in GH?
My thinking is that if I added a small penalty to junctions, then I might be able to achieve my goal of slightly longer routes but with fewer junctions.
Sorry, you’re right, I mean turns. I had avoided using the word “turns” because I know there’s already turn costs in GH, which seem to be specifically for u-turns, but I could be wrong there.
Thanks for the hints, I will experiment with these in the near future, and if I have any joy for foot profiles then I’ll submit a PR.
You don’t necessarily have to enable turn restrictions on the encoder level. You can also try to implement Weighting#calcTurnWeight(int inEdge, int viaNode, int outEdge);. You’d have to write some code to determine whether going from inEdge to outEdge is a ‘turn’ you would like to avoid. The instructions code has some similar logic where where we calculate angles between edges and so on.