brouter icon indicating copy to clipboard operation
brouter copied to clipboard

Allow access to the calculated turncost value, or allow turncost to be node-dependent

Open nglugla opened this issue 1 year ago • 2 comments

I'm running into a strange issue where I'm trying to prevent the engine from considering 180-degree turns as a possibility when using the rail network. By default, it does this extremely often, but this is actually a massive time investment in the real world, but normal curvy rail lines are not. So I need a way to have there be a massive turncost for 180 degree-ish turns, and no turncost at all for anything else. Ideally, I could accomplish this by setting the turncost equal to 1, and then adjusting it again later on so that if the calculated turncost = 2, it gets reset to 100000, and if it's less than that, it gets reset to zero. A compromise that I thought would work would be to have the turncost be high, but only consider it at switches so that curvy lines don't face the penalty, but sharp "switches" do, but this is a node property, so the turncost can't depend on it, leaving me with no way to achieve what I'm going for.

Is there a workaround for this that I'm missing, or would this require a change in the turncost behavior?

nglugla avatar Apr 01 '23 02:04 nglugla

I'm not sure if I understand your issue. Do you have a sample for us? Best done with BRouter-Web

afischerdev avatar Apr 07 '23 11:04 afischerdev

Is there a workaround for this that I'm missing

I don't think so.

would this require a change in the turncost behavior?

Most likely yes.

quaelnix avatar Apr 08 '23 10:04 quaelnix