Skip to content

Include crossing=traffic_signals and use it for walking/cycling penalty on crossings#4574

Merged
optionsome merged 17 commits into
opentripplanner:dev-2.xfrom
HSLdevcom:walk-safety-updates
Dec 15, 2022
Merged

Include crossing=traffic_signals and use it for walking/cycling penalty on crossings#4574
optionsome merged 17 commits into
opentripplanner:dev-2.xfrom
HSLdevcom:walk-safety-updates

Conversation

@optionsome
Copy link
Copy Markdown
Member

@optionsome optionsome commented Nov 4, 2022

Summary

Set a new "crossing traffic light" value on nodes based on crossing=traffic_signals tag and use it for walking/cycling penalty on crossings

Issue

closes #4573

Unit tests

Updated unit tests.

Documentation

Not needed to be updated

@optionsome optionsome added !Improvement A functional improvement or micro feature +Skip Changelog This is not a relevant change for a product owner since last release. Digitransit Test Feature is under testing in Digitransit environment(s) labels Nov 4, 2022
@optionsome optionsome changed the title Update finland walk safety rules Include crossing=traffic_signals and use it for walking/cycling penalty on intersections Nov 17, 2022
@optionsome optionsome removed the +Skip Changelog This is not a relevant change for a product owner since last release. label Nov 17, 2022
@optionsome optionsome changed the title Include crossing=traffic_signals and use it for walking/cycling penalty on intersections Include crossing=traffic_signals and use it for walking/cycling penalty on crossings Nov 17, 2022
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 17, 2022

Codecov Report

Attention: Patch coverage is 96.87500% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.95%. Comparing base (16b16fc) to head (5399b1f).
Report is 7259 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...java/org/opentripplanner/visualizer/ShowGraph.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #4574      +/-   ##
=============================================
+ Coverage      60.86%   60.95%   +0.09%     
- Complexity     12326    12356      +30     
=============================================
  Files           1594     1595       +1     
  Lines          63775    63808      +33     
  Branches        7004     6999       -5     
=============================================
+ Hits           38814    38894      +80     
+ Misses         22780    22738      -42     
+ Partials        2181     2176       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@optionsome optionsome added the +Bump Serialization Id Add this label if you want the serialization id automatically bumped after merging the PR label Nov 17, 2022
Comment thread src/ext-test/java/org/opentripplanner/ext/flex/FlexIntegrationTest.java Outdated
@leonardehrenfried
Copy link
Copy Markdown
Member

leonardehrenfried commented Nov 18, 2022

BTW, I added car-only test cases for the speed test in #4608. If we merge that before this PR then we have a baseline for comparison of the perf impact.

@hannesj hannesj self-requested a review November 22, 2022 09:31
@t2gran t2gran added this to the 2.3 milestone Dec 6, 2022
@optionsome optionsome marked this pull request as ready for review December 8, 2022 15:27
@optionsome optionsome requested a review from a team as a code owner December 8, 2022 15:27
}

public boolean hasTrafficLight() {
public boolean hasHighwayTrafficLight() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be renamed into what they are used for? Are they for vehicles and pedestrians respectively?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highway traffic light is also used for cyclists on car streets, I thought about this too and I ended up naming these like this so how these are used in different types of routing is decided elsewhere.

Comment thread src/main/java/org/opentripplanner/street/model/vertex/IntersectionVertex.java Outdated
Copy link
Copy Markdown
Member

@leonardehrenfried leonardehrenfried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few requests.

It's actually very hard to predict what the outcome of this will be so I think I will have to trust HSL that they've tested this extensively.

final var baseDuration = computeNonDrivingTraversalDuration(from, to, toSpeed);

if (isTurnAcrossTraffic(turnAngle)) {
if (v.hasCyclingTrafficLight()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's possible to have a vertex that is both a traffic light and a turn and even less sure if it matters. I'm happy to keep it that way and experiment with the values a bit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I wasn't quite sure about this either, thought it might not make sense to apply both of these penalties.

@optionsome
Copy link
Copy Markdown
Member Author

optionsome commented Dec 9, 2022

It's actually very hard to predict what the outcome of this will be so I think I will have to trust HSL that they've tested this extensively.

I have tested this with Finland OSM and tag mapping. I would appreciate if someone could also test if this doesn't cause too much problems elsewhere as the tagging conventions etc. can differ.

Copy link
Copy Markdown
Member

@leonardehrenfried leonardehrenfried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this here in Berlin and found the times to be broadly correct.

@optionsome optionsome merged commit c7f6b83 into opentripplanner:dev-2.x Dec 15, 2022
@optionsome optionsome deleted the walk-safety-updates branch December 15, 2022 15:30
t2gran pushed a commit that referenced this pull request Dec 15, 2022
t2gran pushed a commit that referenced this pull request Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

+Bump Serialization Id Add this label if you want the serialization id automatically bumped after merging the PR Digitransit Test Feature is under testing in Digitransit environment(s) !Improvement A functional improvement or micro feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use crossing=traffic_signals tag

5 participants