Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH #86: Add LANE to withTrafficCyclewayTags #142

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

rsarathy
Copy link

@rsarathy rsarathy commented May 8, 2024

Fixes #86:

Screenshot 2024-05-07 at 23 40 17

A painted bike lane is still cycling infrastructure that is shared with car traffic. As such, ways that have cycleway=lane tags but also accommodate car traffic should receive a highway-based penalty.

Adding LANE to withTrafficCyclewayTags allows existing BikeCommonFlagEncoder code to levy a highway-based penalty to the way. This penalty will be p - 1, where p is the highway-based PenaltyCode's level.

@rsarathy rsarathy requested a review from graue May 8, 2024 06:46
@rsarathy rsarathy requested review from abhumbla and removed request for graue May 11, 2024 05:25
@graue
Copy link

graue commented May 11, 2024

a highway-based penalty... will be p - 1, where p is the highway-based PenaltyCode's level.

How did you arrive at this formula? What sort of testing have you done to ensure this still gives reasonable routes elsewhere in SF, East Bay, etc?

@rsarathy
Copy link
Author

We assign the p - 1 penalty in existing BikeCommonFlagEncoder code:

if (withTrafficCyclewayTags.contains(cyclewayForward))
  cyclewayForwardPenalty = PenaltyCode.from(highwayPenalty).tickDownBy(1).getValue();
if (withTrafficCyclewayTags.contains(cyclewayBackward))
  cyclewayBackwardPenalty = PenaltyCode.from(highwayPenalty).tickDownBy(1).getValue();

I'll play around with other bike-only routes to make sure this doesn't break things.

@abhumbla
Copy link

We assign the p - 1 penalty

to be clear, the tickDownBy function goes to the next lower penalty, whatever the value is. it doesn't subtract 1 from the penalty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefer Cayuga over Alemany in SF
3 participants