Documentation update request and questions about u_turn_costs

In the discussion about bicycle step avoidance I was pointed to the u_turn_costs parameter.

As a cyclist, I didn’t look into this parameter so far as I considered it irrelevant for the bicycle profiles. Now I’m trying to understand how this could be used and stumbled over the turn-restrictions.md file. But this file contains a broken link to a turn_costs_calc branch.

My questions are:

  1. Could you please update the documentation and fix the broken link?
  2. Does this functionality somehow allow to individually assign a penalty in seconds to an obstacle such as steps?
  3. If the answer to 2. is yes, would it be possible to dynamically compute such obstacle penalty based on the step_count tag ?

Have updated the link.

I didn’t look into this parameter so far as I considered it irrelevant for the bicycle profiles.

The turn avoidance is important for bike (see bike_avoid_turns.json). Unfortunately we do not have edge-based in production (yet).

Does this functionality somehow allow to individually assign a penalty in seconds to an obstacle such as steps?

Yes, the unit is roughly seconds.

If the answer to 2. is yes, would it be possible to dynamically compute such obstacle penalty based on the step_count tag ?

Yes but I would rather make it dependent on the length instead and depending if there is ascent/descent add further penalty. See also this recent related fix for short edges.

Yes but I would rather make it dependent on the length instead and depending if there is ascent/descent add further penalty.

To use this in a custom model, we probably would need a step_count encoded value. Do you agree? Would you accept a PR adding that?

An encoded value is a bit waste for these rare tags and instead the KVStorage is probably better. (like suggested in this branch)

But I think that the ascend and length is at least an equal valuable metric that we can use for the penalty and does not need any changes.