brouter icon indicating copy to clipboard operation
brouter copied to clipboard

Add turncost for uphill and downhill

Open carg0cult opened this issue 2 years ago • 5 comments

When cycling, it makes a huge difference whether a turn is uphill or downhill. It would be great if we had separate turncost for uphill, downhill and no hill.

carg0cult avatar Jan 08 '23 09:01 carg0cult

Turncosts are only calculated for crossings so not for hairpin bends and other bends.

I think that keeping this in mind the difference in uphill versus downhill cost is small, agreed?

polyscias avatar Jan 15 '23 21:01 polyscias

@polyscias, that's not true. Turncosts are determined each time the direction of travel changes. This continuous road segment does not cross any other way and changing the turncost from 0 to 100 in the "Shortest" profile leads to the following results:

turncost=0 turncost=100
Cost  500 566 

quaelnix avatar Jan 16 '23 15:01 quaelnix

@polyscias, that's not true. Turncosts are determined each time the direction of travel changes.

I have been once experimenting with an on demand profile for some motorbiker with Costfactor offset and negative turncost. He wanted to prefer winding ways to straight ones. It kind of worked, but it had to be conservative otherwise would occacionally cause routing error if the segment cost got negative.

poutnikl avatar Jan 16 '23 15:01 poutnikl

but it had to be conservative otherwise would occacionally cause routing error if the segment cost got negative.

yes, I had also a very big "surprise" with a profile where the cost got < 1 !!! (0.9)

EssBee59 avatar Jan 27 '23 17:01 EssBee59

but it had to be conservative otherwise would occacionally cause routing error if the segment cost got negative.

yes, I had also a very big "surprise" with a profile where the cost got < 1 !!! (0.9)

IIRC, segment cost per length < 1 but > 0 did not raise hard error, but -- if occuring regularly -- would confuse the cut off feature of the 2nd pass of routing engine, that is abandoning route variants estimated not to be better than the 1st pass.

The stumble stones were short segments with significant turncost where cost value was not high enough for negative turncost value.

poutnikl avatar Jan 27 '23 18:01 poutnikl