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

Remove simple restriction check for pedestrians #3423

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* FIXED: Avoid calling out "keep left/right" when passing an exit [3349](https://github.com/valhalla/valhalla/pull/3349)
* FIXED: Fix iterator decrement beyond begin() in GeoPoint::HeadingAtEndOfPolyline() method [#3393](https://github.com/valhalla/valhalla/pull/3393)
* FIXED: Add string for Use:kPedestrianCrossing to fix null output in to_string(Use). [#3416](https://github.com/valhalla/valhalla/pull/3416)
* FIXED: Remove simple restrictions check for pedestrian cost calculation. [#3423](https://github.com/valhalla/valhalla/pull/3423)

* **Enhancement**
* CHANGED: Pronunciation for names and destinations [#3132](https://github.com/valhalla/valhalla/pull/3132)
Expand Down
2 changes: 0 additions & 2 deletions src/sif/pedestriancost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ bool PedestrianCost::Allowed(const baldr::DirectedEdge* edge,
const uint32_t tz_index,
uint8_t& restriction_idx) const {
if (!IsAccessible(edge) || (!pred.deadend() && pred.opp_local_idx() == edge->localedgeidx()) ||
((pred.restrictions() & (1 << edge->localedgeidx())) && !ignore_restrictions_) ||
(edge->surface() > minimal_allowed_surface_) || edge->is_shortcut() ||
IsUserAvoidEdge(edgeid) || edge->sac_scale() > max_hiking_difficulty_ ||
(!pred.deadend() && pred.opp_local_idx() == edge->localedgeidx() &&
Expand Down Expand Up @@ -654,7 +653,6 @@ bool PedestrianCost::AllowedReverse(const baldr::DirectedEdge* edge,
// transit connections. Assume this method is never used in
// multimodal routes).
if (!IsAccessible(opp_edge) || (!pred.deadend() && pred.opp_local_idx() == edge->localedgeidx()) ||
((opp_edge->restrictions() & (1 << pred.opp_local_idx())) && !ignore_restrictions_) ||
(opp_edge->surface() > minimal_allowed_surface_) || opp_edge->is_shortcut() ||
IsUserAvoidEdge(opp_edgeid) || edge->sac_scale() > max_hiking_difficulty_ ||
(!pred.deadend() && pred.opp_local_idx() == edge->localedgeidx() &&
Expand Down
5 changes: 5 additions & 0 deletions test/gurka/test_simple_restrictions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ TEST_F(SimpleRestrictions, IgnoreRestriction) {
gurka::assert::osrm::expect_steps(result, {"BC", "BE", "DEF"});
gurka::assert::raw::expect_path(result, {"BC", "BE", "DEF"});
}
TEST_F(SimpleRestrictions, IgnoreRestrictionPedestrian) {
auto result = gurka::do_action(valhalla::Options::route, map, {"C", "F"}, "pedestrian");
gurka::assert::osrm::expect_steps(result, {"BC", "BE", "DEF"});
gurka::assert::raw::expect_path(result, {"BC", "BE", "DEF"});
}

TEST_F(SimpleRestrictions, IgnoreRestrictionMatching) {
auto result =
Expand Down