-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Simplify handling of safety values #6767
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
base: dev-2.x
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6767 +/- ##
=============================================
- Coverage 72.20% 72.11% -0.09%
- Complexity 20134 20142 +8
=============================================
Files 2183 2183
Lines 81108 80868 -240
Branches 8144 8146 +2
=============================================
- Hits 58561 58316 -245
- Misses 19666 19672 +6
+ Partials 2881 2880 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/osm/tagmapping/UKMapper.java
Outdated
Show resolved
Hide resolved
miklcct
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wip
24f1bbf to
09e6fd4
Compare
09e6fd4 to
15cda2c
Compare
# Conflicts: # application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java # application/src/test/java/org/opentripplanner/generate/doc/OsmMapperDocTest.java # application/src/test/java/org/opentripplanner/osm/tagmapping/GermanyMapperTest.java # application/src/test/java/org/opentripplanner/osm/tagmapping/OsmTagMapperTest.java # application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/TransitSnapshotTest.snap # application/src/test/resources/speedtest/travelSearch-expected-results-bd.csv # doc/user/osm/Finland.md # doc/user/osm/Germany.md # doc/user/osm/OsmTag.md # doc/user/osm/UK.md
# Conflicts: # application/src/test/java/org/opentripplanner/generate/doc/OsmMapperDocTest.java
# Conflicts: # application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/BikeRentalSnapshotTest.snap # application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/CarSnapshotTest.snap # application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/ElevationSnapshotTest.snap # application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/TransitSnapshotTest.snap # application/src/test/resources/speedtest/travelSearch-expected-results-bd.csv # application/src/test/resources/speedtest/travelSearch-expected-results-mc.csv # application/src/test/resources/speedtest/travelSearch-expected-results-md.csv # application/src/test/resources/speedtest/travelSearch-expected-results-sr.csv
|
I think this is ready now but a thorough discussion is needed among stakeholders for the desired values. It also has implication on #6782 as well. |
|
Could the addition of walk safety be split into a separate pr so this would be simpler to review? |
I have removed walk safety here and drafted #6944 |
003326c to
a4f5676
Compare
# Conflicts: # application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java # application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/ElevationSnapshotTest.snap # doc/user/osm/Finland.md # doc/user/osm/Germany.md # doc/user/osm/OsmTag.md # doc/user/osm/UK.md
|
I tested this a bit with HSL data and FinlandMapper. I noticed that on ways ways like https://www.openstreetmap.org/way/23571016 the bicycle safety value changed quite a bit (it was 5.95 before, now it is 2.38). Is this expected change? I think the key thing here is the highway=footway and bicycle=yes combo, but I think the surface also affects the values a bit but I'm not sure if in the same proportion as before. I'll have to talk to our OSM guy what sort of safety values we would actually expect from these ways. The original 5.95 feels a bit high and there were some like https://www.openstreetmap.org/way/229825375 which had 7.02 bicycle safety, which is starting to approach the safety values on some car streets which we don't people to cycle on. |
optionsome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like these changes in general. The configuration and documentation seem cleaner now. However, there are some changes to safety values which seem more than just minor changes.
| } else if (value == forward && value == backward) { | ||
| return value.toString(); | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to use the elses when you always have a return in the condition.
|
I discussed the changes to the highway=footway + bicycle=yes ways with our OSM editor and he also throught that previously they had slightly too high safety values. However, we noticed that https://www.openstreetmap.org/way/235220367 has now a higher bicycle safety value than the road that its crossing which might be slightly problematic as it could lead to avoidance of the cycleway in some cases. |
The current version is so complicated that it is hard to set the appropriate value when tags interact each others in a way which we didn't expect. If the simplification results in more sensible values for more sensible tags combination that is my intention. And thanks for finding out the crossing value is problematic, in the current version it also has a high safety value to deter using them (when it is a footway crossing which you are allowed to cycle through) but you have now mentioned that you don't want this, so I will adjust it to be much lower. |
|
This pr looks ok to me, but we need a second reviewer. |
# Conflicts: # application/src/test/java/org/opentripplanner/routing/algorithm/mapping/__snapshots__/ElevationSnapshotTest.snap
habrahamsson-skanetrafiken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a nice simplification. It's impossible to foresee all the consequences of this, but if any specific issues show up they shouldn't be very difficult to address.
Summary
This simplifies the OSM mappers by using mixins to add permissions and multiply safety values. It removes a large number of matches just to override the safety numbers and to add bicycle mode.
This will be a follow up for #6764.
Issue
None yet
Unit tests
Existing tests are updated. In particular, tests which plan journeys need to have their expectation changed as the routing results are changed due to the simplified safety values, which approximate but not exactly equal the old values.
Documentation
Updated
Changelog
Needed
Bumping the serialization version id