Take stop signs into account during routing
This commit is contained in:
parent
62298cf409
commit
be1b86657c
@ -33,7 +33,45 @@ Feature: Car - Handle give way signs
|
||||
|
||||
When I route I should get
|
||||
| from | to | time | # |
|
||||
| 1 | 2 | 11.1s | no turn with no stop sign |
|
||||
| 3 | 4 | 13.1s | no turn with stop sign |
|
||||
| g | j | 18.7s | turn with no stop sign |
|
||||
| k | n | 20.7s | turn with stop sign |
|
||||
| 1 | 2 | 11.1s | no turn with no give way |
|
||||
| 3 | 4 | 13.1s | no turn with give way |
|
||||
| g | j | 18.7s | turn with no give way |
|
||||
| k | n | 20.7s | turn with give way |
|
||||
|
||||
|
||||
Scenario: Car - Give way direction
|
||||
Given the node map
|
||||
"""
|
||||
a-1-b-2-c
|
||||
|
||||
d-3-e-4-f
|
||||
|
||||
g-5-h-6-i
|
||||
|
||||
j-7-k-8-l
|
||||
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| def | primary |
|
||||
| ghi | primary |
|
||||
| jkl | primary |
|
||||
|
||||
And the nodes
|
||||
| node | highway | direction |
|
||||
| e | give_way | |
|
||||
| h | give_way | forward |
|
||||
| k | give_way | backward |
|
||||
|
||||
When I route I should get
|
||||
| from | to | time | weight | # |
|
||||
| 1 | 2 | 11.1s | 11.1 | no turn with no give way |
|
||||
| 2 | 1 | 11.1s | 11.1 | no turn with no give way |
|
||||
| 3 | 4 | 13.1s | 13.1 | no turn with give way |
|
||||
| 4 | 3 | 13.1s | 13.1 | no turn with give way |
|
||||
| 5 | 6 | 13.1s | 13.1 | no turn with give way |
|
||||
| 6 | 5 | 11.1s | 11.1 | no turn with no give way |
|
||||
| 7 | 8 | 11.1s | 11.1 | no turn with no give way |
|
||||
| 8 | 7 | 13.1s | 13.1 | no turn with give way |
|
||||
|
@ -36,4 +36,41 @@ Feature: Car - Handle stop signs
|
||||
| 1 | 2 | 11.1s | no turn with no stop sign |
|
||||
| 3 | 4 | 13.1s | no turn with stop sign |
|
||||
| g | j | 18.7s | turn with no stop sign |
|
||||
| k | n | 20.7s | turn with stop sign |
|
||||
| k | n | 20.7s | turn with stop sign |
|
||||
|
||||
Scenario: Car - Stop sign direction
|
||||
Given the node map
|
||||
"""
|
||||
a-1-b-2-c
|
||||
|
||||
d-3-e-4-f
|
||||
|
||||
g-5-h-6-i
|
||||
|
||||
j-7-k-8-l
|
||||
|
||||
"""
|
||||
|
||||
And the ways
|
||||
| nodes | highway |
|
||||
| abc | primary |
|
||||
| def | primary |
|
||||
| ghi | primary |
|
||||
| jkl | primary |
|
||||
|
||||
And the nodes
|
||||
| node | highway | direction |
|
||||
| e | stop | |
|
||||
| h | stop | forward |
|
||||
| k | stop | backward |
|
||||
|
||||
When I route I should get
|
||||
| from | to | time | weight | # |
|
||||
| 1 | 2 | 11.1s | 11.1 | no turn with no stop sign |
|
||||
| 2 | 1 | 11.1s | 11.1 | no turn with no stop sign |
|
||||
| 3 | 4 | 13.1s | 13.1 | no turn with stop sign |
|
||||
| 4 | 3 | 13.1s | 13.1 | no turn with stop sign |
|
||||
| 5 | 6 | 13.1s | 13.1 | no turn with stop sign |
|
||||
| 6 | 5 | 11.1s | 11.1 | no turn with no stop sign |
|
||||
| 7 | 8 | 11.1s | 11.1 | no turn with no stop sign |
|
||||
| 8 | 7 | 13.1s | 13.1 | no turn with stop sign |
|
||||
|
@ -1197,7 +1197,7 @@ ExtractionContainers::IdentifyTrafficFlowControlNodes(
|
||||
};
|
||||
std::for_each(external_nodes.begin(), external_nodes.end(), mark_traffic_nodes);
|
||||
|
||||
// Extract all the segments that lead up to unidirectional traffic signals.
|
||||
// Extract all the segments that lead up to unidirectional traffic flow control nodes.
|
||||
const auto set_segments = [&](const size_t way_list_idx, auto const & /*unused*/) {
|
||||
const auto node_start_offset =
|
||||
used_node_id_list.begin() + way_node_id_offsets[way_list_idx];
|
||||
|
@ -126,6 +126,7 @@
|
||||
{"key": "route", "object_types": ["way"]},
|
||||
{"key": "highway", "value": "traffic_signals", "object_types": ["node"]},
|
||||
{"key": "highway", "value": "stop", "object_types": ["node"]},
|
||||
{"key": "highway", "value": "give_way", "object_types": ["node"]},
|
||||
{"key": "highway", "value": "crossing", "object_types": ["node"]},
|
||||
{"key": "access", "value": "yes"},
|
||||
{"key": "access", "value": "motorcar"},
|
||||
|
Loading…
Reference in New Issue
Block a user