Is it possible to remove a custom weighting while supplying the algoOpts to the createAlgo method? Where should I be looking to customise this if it doesn’t exist already?
I don’t really understand the question, but you should be able to extend GraphHopper to do almost everything you want. I would probably start at the createAlgo method or the place where this method gets called.
Cheers,
Robin
This is my calcPaths method where I can dynamically add a weigthing to my algoOpts,
AvoidEdgesWeighting avoidPathWeighting = new AvoidEdgesWeighting(algoOpts.getWeighting());
avoidPathWeighting.setEdgePenaltyFactor(5);
algoOpts = AlgorithmOptions.start(algoOpts).algorithm(Parameters.Algorithms.ASTAR_BI)
.weighting(avoidPathWeighting).build();
Now what if my want to remove a weighting instead of adding?
I think I figured it out. Instead of adding the weighting all at once I can add the weighting only when needed just like the
createTurnWeighting
method.in the Graphhopper class