-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Penalize turns from non-local access only edges to local access only edges #3721
Conversation
There's one scenario that I can think of that's very similar, but not covered by this: Nodes: http://wiki.openstreetmap.org/wiki/Tag:barrier=toll_booth I think this PR could handle the Some highways only have |
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.
Nice 👍 Should we engage the OSM community - there might be more tags out there we might be missing.
'agricultural', | ||
'forestry', | ||
'emergency', | ||
'psv', | ||
'delivery' | ||
'psv' |
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.
Is there a reason for having the blacklist at all now? If we never route onto the local access ways we're fine in the sense of "blacklisting" them from routing. But if users somehow end up on those ways we still want to be able to route them off of them?
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 is a good point. As someone who has definitely driven onto roads I wasn't supposed to be on, routing out of these is probably a better way to handle them, rather than pretending they don't exist in the road network.
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'll ticket this and do it in a separate PR because it will involve changing all tests that test access of any kind.
profiles/car.lua
Outdated
@@ -358,6 +358,7 @@ function way_function(way, result) | |||
Handlers.run(handlers,way,result,data,profile) | |||
end | |||
|
|||
-- Called during edge-based-graph creation |
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.
Hm maybe remove impl. detail comment here, I think this might just confuse users who have no idea about the C++ side of things.
profiles/car.lua
Outdated
if not turn.source_local_access_only and turn.target_local_access_only then | ||
turn.weight = turn.weight + 3000 | ||
end | ||
end |
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.
Can we symbolize both routability as well as 3000. Also why 3000?
unit_tests/library/tile.cpp
Outdated
@@ -205,7 +205,7 @@ BOOST_AUTO_TEST_CASE(test_tile) | |||
} | |||
|
|||
BOOST_CHECK_EQUAL(number_of_turn_keys, 3); | |||
BOOST_CHECK_EQUAL(number_of_turns_found, 732); | |||
BOOST_CHECK_EQUAL(number_of_turns_found, 763); |
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.
Should we remove exact checks here - every other pull request has to adapt these numbers
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.
yeah this is annoying
Btw |
bbeb938
to
8bba0f0
Compare
8bba0f0
to
2e1b976
Compare
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.
Looks good, but maybe we can think about a better name for the property exposed via profile API.
include/extractor/extraction_way.hpp
Outdated
@@ -106,6 +108,8 @@ struct ExtractionWay | |||
bool roundabout; | |||
bool circular; | |||
bool is_startpoint; | |||
bool backward_local_access_only; |
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.
Using the term restricted
instead of local_access_only
might be more in line with our usual vocabulary for this. My suggestion would be {backward,forward}_restricted
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.
As per slack, renamed.
profiles/car.lua
Outdated
@@ -34,6 +34,9 @@ local profile = { | |||
speed_reduction = 0.8, | |||
traffic_light_penalty = 2, | |||
u_turn_penalty = 20, | |||
local_access_penalty = 3000, |
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.
Possibly rename to restriced_penalty
930a434
to
a5ae836
Compare
7265638
to
144338c
Compare
Issue
Closes #156
Instead of completely removing ways tagged with local access only or routing over them with impunity, this pr adds a heavy penalty on turn maneuvers from non-local access only edges to local access only edges. This allows routing onto a local access only, but only if the destination of the route ends on the way.
"Local access only" is defined in the
local_access_tag_list
set in the car lua profile. The default profile includes ways tagged likeTasklist