Skip to content

Do not allow bicycle traversal on ways tagged with mtb:scale - #3578

Merged
gmellemstrand merged 5 commits into
opentripplanner:dev-2.xfrom
entur:otp2_exclude_mtb_for_biking
Aug 9, 2021
Merged

Do not allow bicycle traversal on ways tagged with mtb:scale#3578
gmellemstrand merged 5 commits into
opentripplanner:dev-2.xfrom
entur:otp2_exclude_mtb_for_biking

Conversation

@gmellemstrand

Copy link
Copy Markdown
Contributor

Summary

This PR restricts the traversal of mtb:scale tagged ways:
mtb:scale=0 - Pedestrian and bicycle
mtb:scale=1 - Pedestrian only
mtb:scale=2 - Pedestrian only
mtb:scale=3 - No traversal
mtb:scale=4 - No traversal
mtb:scale=5 - No traversal
mtb:scale=6 - No traversal

It also renames the RoutingRequest.optimize field to bicycleOptimizeType and sets the default to SAFE instead of QUICK.

Also, the Transmodel API now reads the correct field when applying bicycleOptimizeType to the RoutingRequest.

Issue

No issue

Unit tests

Added new unit tests for the WayPropertySource

Changelog

Added changelog

@gmellemstrand gmellemstrand added the !Improvement A functional improvement or micro feature label Aug 6, 2021
@gmellemstrand
gmellemstrand requested a review from a team as a code owner August 6, 2021 14:06
}

@Test
public void testMtbScalePedestrian() {

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.

I like this test but after having looked around the the OSM data in Norway, I found that the mtb:scale tag is also used in combination with highway=track.

Examples:

https://www.openstreetmap.org/way/514943207
https://www.openstreetmap.org/way/370993765

I think it'd be worthwhile to add a test for this, too, to prevent someone breaking it by accident.

@leonardehrenfried leonardehrenfried left a comment

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.

I think this is a good change and support it. Other than the slightly more extensive testing, I like this PR a lot.

@gmellemstrand
gmellemstrand merged commit 0549a7b into opentripplanner:dev-2.x Aug 9, 2021
@gmellemstrand
gmellemstrand deleted the otp2_exclude_mtb_for_biking branch August 9, 2021 09:03
@t2gran t2gran added this to the 2.1 milestone Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Improvement A functional improvement or micro feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants