abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
490 stars 118 forks source link

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

Open nglugla opened 1 year ago

nglugla commented 1 year ago

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?

afischerdev commented 1 year ago

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

quaelnix commented 1 year ago

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.