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.
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.