Update tests expectations and obvious detection

This commit is contained in:
Michael Krasnyk 2018-02-13 16:08:53 +01:00
parent d166fc6a75
commit 8b52c6c7ac
13 changed files with 328 additions and 930 deletions

View File

@ -135,12 +135,12 @@ Feature: Car - Destination only, no passing through
Scenario: Car - Routing through a parking lot tagged access=destination,service Scenario: Car - Routing through a parking lot tagged access=destination,service
Given the node map Given the node map
""" """
a----c++++b+++g----h---i a----c++++b+++g------h---i
| + + + | | + + + /
| + + + | | + + + /
| + + + | | + + + /
| d++++e+f / | d++++e+f /
z---------------y z--------------y
""" """
And the ways And the ways
@ -155,9 +155,10 @@ Feature: Car - Destination only, no passing through
| gf | destination | service | | gf | destination | service |
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | i | azyhi,azyhi | | a | i | azyhi,azyhi |
| b | f | be,def,def | | b | f | be,def,def |
| b | i | cbg,ghi,azyhi,azyhi |
Scenario: Car - Disallow snapping to access=private,highway=service Scenario: Car - Disallow snapping to access=private,highway=service
Given a grid size of 20 meters Given a grid size of 20 meters

View File

@ -385,7 +385,7 @@ Feature: Collapse
| a,g | first,second,second | depart,turn left,arrive | a,b,g | | a,g | first,second,second | depart,turn left,arrive | a,b,g |
| d,g | first,second,second | depart,turn right,arrive | d,e,g | | d,g | first,second,second | depart,turn right,arrive | d,e,g |
| g,f | second,first,first | depart,turn right,arrive | g,e,f | | g,f | second,first,first | depart,turn right,arrive | g,e,f |
| g,c | second,first,first | depart,turn left,arrive | g,e,c | | g,c | second,first,first | depart,end of road left,arrive | g,b,c |
Scenario: Do not collapse turning roads Scenario: Do not collapse turning roads
Given the node map Given the node map
@ -1010,7 +1010,7 @@ Feature: Collapse
| f,j | hohe,hohe | depart,arrive | f,j | | f,j | hohe,hohe | depart,arrive | f,j |
| a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t | | a,t | hohe,a100,a100 | depart,on ramp right,arrive | a,b,t |
| f,e | | | | | f,e | | | |
| q,j | a100,hohe,hohe | depart,turn right,arrive | q,p,j | | q,j | a100,hohe,hohe | depart,turn right,arrive | q,i,j |
| q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e | | q,e | a100,hohebruecke,hohe | depart,turn left,arrive | q,p,e |
Scenario: Forking before a turn (forky) Scenario: Forking before a turn (forky)

View File

@ -687,7 +687,7 @@ Feature: Slipways and Dedicated Turn Lanes
When I route I should get When I route I should get
| waypoints | route | turns | locations | | waypoints | route | turns | locations |
| s,f | sabc,ae,dbef,dbef | depart,turn slight right,turn right,arrive | s,a,e,f | | s,f | sabc,ae,dbef,dbef | depart,fork slight right,turn right,arrive | s,a,e,f |
@sliproads @sliproads
Scenario: Traffic Signal on Sliproad Scenario: Traffic Signal on Sliproad

View File

@ -64,9 +64,9 @@ Feature: Exceptions for routing onto low-priority roads
| bc | service | | | bc | service | |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| e,c | service, | depart,arrive | | e,c | service, | depart,arrive |
| c,e | ,service,service | depart,turn straight,arrive | | c,e | ,service | depart,arrive |
Scenario: Straight onto low-priority Scenario: Straight onto low-priority
Given the node map Given the node map

View File

@ -384,9 +384,9 @@ Feature: Merge Segregated Roads
| cd | right | no | | cd | right | no |
When I route I should get When I route I should get
| waypoints | route | intersections | | waypoints | route | intersections |
| a,d | left,circle,circle,right,right | true:90;false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 | | a,d | left,circle,right,right | true:90,false:90 true:120 false:270;true:60 true:180 false:300;true:90 false:240 true:270;true:270 |
| g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 | | g,d | bottom,circle,right,right | true:0;true:60 false:180 false:300;true:90 false:240 true:270;true:270 |
Scenario: Middle Island Scenario: Middle Island
Given the node map Given the node map
@ -644,7 +644,7 @@ Feature: Merge Segregated Roads
| k,j | marianne,albrecht,luise,luise | depart,turn left,turn left,arrive | | k,j | marianne,albrecht,luise,luise | depart,turn left,turn left,arrive |
| k,d | marianne,schwert,schwert | depart,turn right,arrive | | k,d | marianne,schwert,schwert | depart,turn right,arrive |
| i,j | luise,luise | depart,arrive | | i,j | luise,luise | depart,arrive |
| i,d | luise,albrecht,schwert,schwert | depart,turn left,turn straight,arrive | | i,d | luise,albrecht,schwert | depart,turn left,arrive |
| i,l | luise,albrecht,marianne,marianne | depart,turn left,turn left,arrive | | i,l | luise,albrecht,marianne,marianne | depart,turn left,turn left,arrive |
# https://www.openstreetmap.org/#map=19/52.46339/13.40272 # https://www.openstreetmap.org/#map=19/52.46339/13.40272

View File

@ -300,10 +300,11 @@ Feature: Simple Turns
When I route I should get When I route I should get
| from | to | route | turns | | from | to | route | turns |
| a | d | , | depart,turn right,arrive | | a | d | ,, | depart,turn right,arrive |
# https://www.openstreetmap.org/#map=19/37.61256/-122.40371 # https://www.openstreetmap.org/#map=19/37.61256/-122.40371
@todo
Scenario: Turning Road with Offset at Segregated Intersection Scenario: Turning Road with Offset at Segregated Intersection
Given the node map Given the node map
""" """

View File

@ -899,9 +899,9 @@ Feature: Simple Turns
""" """
And the ways And the ways
| nodes | highway | name | | nodes | highway | name | lanes |
| abc | primary | road | | abc | primary | road | 3 |
| bd | residential | in | | bd | residential | in | 1 |
When I route I should get When I route I should get
| waypoints | turns | route | | waypoints | turns | route |
@ -1434,21 +1434,21 @@ Feature: Simple Turns
Scenario: Turn for roads with no name, ref changes Scenario: Turn for roads with no name, ref changes
Given the node map Given the node map
""" """
x x
. .
. .
d d
. . . .
. . . .
. . . .
e. . t . c . p. .f e. . t . c . p. .f
. . . .
. . . .
. . . .
b b
. .
. .
a a
""" """
And the ways And the ways
@ -1460,6 +1460,6 @@ Feature: Simple Turns
| etcpf | primary | B 1 | | no | | etcpf | primary | B 1 | | no |
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| e,x | ,,, | depart,turn sharp left,turn right,arrive | | e,x | ,, | depart,turn left,arrive |
| f,a | ,, | depart,turn left,arrive | | f,a | ,, | depart,turn left,arrive |

View File

@ -108,12 +108,12 @@ Feature: Bearing parameter
| ha | yes | ring | | ha | yes | ring |
When I route I should get When I route I should get
| from | to | bearings | route | bearing | | from | to | bearings | route | bearing |
| 0 | q | 0 90 | ia,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,90->0 | | 0 | q | 0 90 | ia,ring,ring,ring,ring,ring | 0->0,0->90,180->270,270->0,0->90,90->0 |
| 0 | a | 45 90 | jb,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,90->0 | | 0 | a | 45 90 | jb,ring,ring,ring,ring,ring | 0->45,45->180,180->270,270->0,0->90,90->0 |
| 0 | q | 90 90 | kc,ring,ring,ring | 0->90,90->180,270->0,90->0 | | 0 | q | 90 90 | kc,ring,ring,ring,ring | 0->90,90->180,270->0,0->90,90->0 |
| 0 | a | 135 90 | ld,ring,ring,ring | 0->135,135->270,270->0,90->0 | | 0 | a | 135 90 | ld,ring,ring,ring,ring | 0->135,135->270,270->0,0->90,90->0 |
| 0 | a | 180 90 | me,ring,ring,ring | 0->180,180->270,270->0,90->0 | | 0 | a | 180 90 | me,ring,ring,ring,ring | 0->180,180->270,270->0,0->90,90->0 |
| 0 | a | 225 90 | nf,ring,ring | 0->225,225->0,90->0 | | 0 | a | 225 90 | nf,ring,ring,ring | 0->225,225->0,0->90,90->0 |
| 0 | a | 270 90 | og,ring,ring | 0->270,270->0,90->0 | | 0 | a | 270 90 | og,ring,ring,ring | 0->270,270->0,0->90,90->0 |
| 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 | | 0 | a | 315 90 | ph,ring,ring | 0->315,315->90,90->0 |

View File

@ -154,16 +154,17 @@ inline std::uint32_t getRoadGroup(const RoadClassification classification)
return upper - dividers; return upper - dividers;
} }
// a road classification is strictly less, if it belongs to a lower general category of roads. E.g. // LHS road classification is strictly less than RHS, if it belongs to a lower general category
// normal city roads are strictly less of a priority than a motorway and alleys are strictly less // of roads. E.g. normal city roads are strictly less of a priority than a motorway and alleys
// than inner-city roads // are strictly less than inner-city roads.
inline bool strictlyLess(const RoadClassification lhs, const RoadClassification rhs) inline bool strictlyLess(const RoadClassification lhs, const RoadClassification rhs)
{ {
const auto lhs_class = getRoadGroup(lhs); if (!lhs.IsLowPriorityRoadClass() && rhs.IsLowPriorityRoadClass())
const auto rhs_class = getRoadGroup(rhs); return false;
// different class, not neighbors if (lhs.IsLowPriorityRoadClass() && !rhs.IsLowPriorityRoadClass())
return lhs_class > rhs_class && return true;
((lhs.GetPriority() - rhs.GetPriority() > 4) || lhs.IsLowPriorityRoadClass());
return getRoadGroup(lhs) > getRoadGroup(rhs);
} }
// check whether a link class is the fitting link class to a road // check whether a link class is the fitting link class to a road

File diff suppressed because it is too large Load Diff

View File

@ -70,24 +70,23 @@ parking_class = Set{
function Guidance.set_classification (highway, result, input_way) function Guidance.set_classification (highway, result, input_way)
if motorway_types[highway] then if motorway_types[highway] then
result.road_classification.motorway_class = true; result.road_classification.motorway_class = true
end end
if link_types[highway] then if link_types[highway] then
result.road_classification.link_class = true; result.road_classification.link_class = true
end end
-- we distinguish between different service types, if specified, we recognise parking and alleys. -- All service roads are recognised as alley
-- If we see an unrecognised type, we assume a pure connectivity road. All unspecified are recognised as alley
if highway ~= nil and highway == 'service' then if highway ~= nil and highway == 'service' then
local service_type = input_way:get_value_by_key('service'); local service_type = input_way:get_value_by_key('service');
if service_type ~= nil and parking_class[service_type] then if service_type ~= nil and parking_class[service_type] then
result.road_classification.road_priority_class = road_priority_class.parking; result.road_classification.road_priority_class = road_priority_class.alley
else else
if service_type ~= nil and service_type == 'alley' then if service_type ~= nil and service_type == 'alley' then
result.road_classification.road_priority_class = road_priority_class.alley; result.road_classification.road_priority_class = road_priority_class.alley
else else
if serice_type == nil then if serice_type == nil then
result.road_classification.road_priority_class = road_priority_class.alley; result.road_classification.road_priority_class = road_priority_class.alley
else else
result.road_classification.road_priority_class = highway_classes[highway] result.road_classification.road_priority_class = highway_classes[highway]
end end

View File

@ -240,6 +240,7 @@ void AdjustToCombinedTurnStrategy::operator()(RouteStep &step_at_turn_location,
setInstructionType(step_at_turn_location, TurnType::Turn); setInstructionType(step_at_turn_location, TurnType::Turn);
} }
else if (hasTurnType(step_at_turn_location, TurnType::Turn) && else if (hasTurnType(step_at_turn_location, TurnType::Turn) &&
!hasTurnType(transfer_from_step, TurnType::Suppressed) &&
haveSameName(step_prior_to_intersection, transfer_from_step)) haveSameName(step_prior_to_intersection, transfer_from_step))
{ {
setInstructionType(step_at_turn_location, TurnType::Continue); setInstructionType(step_at_turn_location, TurnType::Continue);

View File

@ -852,6 +852,11 @@ SliproadHandler::scaledThresholdByRoadClass(const double max_threshold,
case extractor::RoadPriorityClass::SIDE_RESIDENTIAL: case extractor::RoadPriorityClass::SIDE_RESIDENTIAL:
factor = 0.3; factor = 0.3;
break; break;
case extractor::RoadPriorityClass::MOTORWAY_LINK:
case extractor::RoadPriorityClass::TRUNK_LINK:
case extractor::RoadPriorityClass::PRIMARY_LINK:
case extractor::RoadPriorityClass::SECONDARY_LINK:
case extractor::RoadPriorityClass::TERTIARY_LINK:
case extractor::RoadPriorityClass::LINK_ROAD: case extractor::RoadPriorityClass::LINK_ROAD:
factor = 0.3; factor = 0.3;
break; break;