Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 607fbce1ef | |||
| 06330a694e | |||
| cbecdf8a4f |
@@ -1,3 +1,10 @@
|
|||||||
|
# 5.15.1
|
||||||
|
- Changes from 5.15.0:
|
||||||
|
- Bugfixes:
|
||||||
|
- FIXED: Segfault in map matching when RouteLeg collapsing code is run on a match with multiple submatches
|
||||||
|
- Guidance:
|
||||||
|
- Set type of trivial intersections where classes change to Suppressed instead of NoTurn
|
||||||
|
|
||||||
# 5.15.0
|
# 5.15.0
|
||||||
- Changes from 5.14.3:
|
- Changes from 5.14.3:
|
||||||
- Bugfixes:
|
- Bugfixes:
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ endif()
|
|||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
set(OSRM_VERSION_MAJOR 5)
|
set(OSRM_VERSION_MAJOR 5)
|
||||||
set(OSRM_VERSION_MINOR 15)
|
set(OSRM_VERSION_MINOR 15)
|
||||||
set(OSRM_VERSION_PATCH 0)
|
set(OSRM_VERSION_PATCH 1)
|
||||||
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
|
||||||
|
|
||||||
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|||||||
@@ -119,6 +119,25 @@ Feature: Car - Mode flag
|
|||||||
| from | to | route | turns | classes |
|
| from | to | route | turns | classes |
|
||||||
| a | d | ab,bc,cd,cd | depart,new name right,new name left,arrive | [()],[(tunnel)],[()],[()] |
|
| a | d | ab,bc,cd,cd | depart,new name right,new name left,arrive | [()],[(tunnel)],[()],[()] |
|
||||||
|
|
||||||
|
Scenario: Car - We tag classes without intersections
|
||||||
|
Background:
|
||||||
|
Given a grid size of 200 meters
|
||||||
|
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a b c d
|
||||||
|
"""
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | name | tunnel |
|
||||||
|
| ab | road | |
|
||||||
|
| bc | road | yes |
|
||||||
|
| cd | road | |
|
||||||
|
|
||||||
|
When I route I should get
|
||||||
|
| from | to | route | turns | classes |
|
||||||
|
| a | d | road,road | depart,arrive | [(),(tunnel),()],[()] |
|
||||||
|
|
||||||
Scenario: Car - From roundabout on toll road
|
Scenario: Car - From roundabout on toll road
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
@@ -144,4 +163,3 @@ Feature: Car - Mode flag
|
|||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | turns | classes |
|
| from | to | route | turns | classes |
|
||||||
| a | f | ab,df,df,df | depart,roundabout-exit-2,exit roundabout slight right,arrive | [()],[(),(motorway)],[(toll,motorway)],[()] |
|
| a | f | ab,df,df,df | depart,roundabout-exit-2,exit roundabout slight right,arrive | [()],[(),(motorway)],[(toll,motorway)],[()] |
|
||||||
|
|
||||||
|
|||||||
@@ -98,11 +98,11 @@ Feature: Car - Guidance - Bridges and Tunnels
|
|||||||
| dce | primary | | Nebenstraße |
|
| dce | primary | | Nebenstraße |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | turns |
|
| from | to | route | turns |
|
||||||
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn left,arrive |
|
| a | d | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road left,arrive |
|
||||||
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,turn right,arrive |
|
| a | e | Hauptstraße,Nebenstraße,Nebenstraße | depart,end of road right,arrive |
|
||||||
| e | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn left,arrive |
|
| e | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn left,arrive |
|
||||||
| d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive |
|
| d | a | Nebenstraße,Hauptstraßentunnel,Hauptstraße | depart,turn right,arrive |
|
||||||
|
|
||||||
Scenario: Tunnel with Immediate Turn Front and Back
|
Scenario: Tunnel with Immediate Turn Front and Back
|
||||||
Given the node map
|
Given the node map
|
||||||
@@ -129,4 +129,3 @@ Feature: Car - Guidance - Bridges and Tunnels
|
|||||||
| e | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,turn left,arrive |
|
| e | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn left,turn left,arrive |
|
||||||
| d | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn right,arrive |
|
| d | f | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn right,arrive |
|
||||||
| d | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn left,arrive |
|
| d | g | Nebenstraße,Hauptstraßentunnel,Anderestraße,Anderestraße | depart,turn right,turn left,arrive |
|
||||||
|
|
||||||
|
|||||||
@@ -603,3 +603,26 @@ Feature: Basic Map Matching
|
|||||||
When I match I should get
|
When I match I should get
|
||||||
| trace | timestamps | code |
|
| trace | timestamps | code |
|
||||||
| ab1d | 0 1 2 3 | NoMatch |
|
| ab1d | 0 1 2 3 | NoMatch |
|
||||||
|
|
||||||
|
Scenario: Regression test - avoid collapsing legs of a tidied split trace
|
||||||
|
Given a grid size of 20 meters
|
||||||
|
Given the node map
|
||||||
|
"""
|
||||||
|
a--b--f
|
||||||
|
|
|
||||||
|
|
|
||||||
|
e--c---d--g
|
||||||
|
"""
|
||||||
|
Given the query options
|
||||||
|
| tidy | true |
|
||||||
|
|
||||||
|
And the ways
|
||||||
|
| nodes | oneway |
|
||||||
|
| abf | no |
|
||||||
|
| be | no |
|
||||||
|
| ecdg | no |
|
||||||
|
|
||||||
|
When I match I should get
|
||||||
|
| trace | timestamps | matchings | code |
|
||||||
|
| abbecd | 10 11 27 1516914902 1516914913 1516914952 | ab,ecd | Ok |
|
||||||
|
|
||||||
|
|||||||
@@ -48,12 +48,14 @@ inline Result keep_all(const MatchParameters ¶ms)
|
|||||||
|
|
||||||
result.can_be_removed.resize(params.coordinates.size(), false);
|
result.can_be_removed.resize(params.coordinates.size(), false);
|
||||||
result.was_waypoint.resize(params.coordinates.size(), true);
|
result.was_waypoint.resize(params.coordinates.size(), true);
|
||||||
|
// by default all input coordinates are treated as waypoints
|
||||||
if (!params.waypoints.empty())
|
if (!params.waypoints.empty())
|
||||||
{
|
{
|
||||||
for (const auto p : params.waypoints)
|
for (const auto p : params.waypoints)
|
||||||
{
|
{
|
||||||
result.was_waypoint.set(p, false);
|
result.was_waypoint.set(p, false);
|
||||||
}
|
}
|
||||||
|
// logic is a little funny, uses inversion to set the bitfield
|
||||||
result.was_waypoint.flip();
|
result.was_waypoint.flip();
|
||||||
}
|
}
|
||||||
result.tidied_to_original.reserve(params.coordinates.size());
|
result.tidied_to_original.reserve(params.coordinates.size());
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ class IntersectionHandler
|
|||||||
// Decide on a basic turn types
|
// Decide on a basic turn types
|
||||||
TurnType::Enum findBasicTurnType(const EdgeID via_edge, const ConnectedRoad &candidate) const;
|
TurnType::Enum findBasicTurnType(const EdgeID via_edge, const ConnectedRoad &candidate) const;
|
||||||
|
|
||||||
|
TurnType::Enum areSameClasses(const EdgeID via_edge, const ConnectedRoad &road) const;
|
||||||
|
|
||||||
// Find the most obvious turn to follow. The function returns an index into the intersection
|
// Find the most obvious turn to follow. The function returns an index into the intersection
|
||||||
// determining whether there is a road that can be seen as obvious turn in the presence of many
|
// determining whether there is a road that can be seen as obvious turn in the presence of many
|
||||||
// other possible turns. The function will consider road categories and other inputs like the
|
// other possible turns. The function will consider road categories and other inputs like the
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "osrm",
|
"name": "osrm",
|
||||||
"version": "5.15.0",
|
"version": "5.15.1",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
|
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -247,6 +247,7 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Error: Check if user-supplied waypoints can be found in the resulting matches
|
// Error: Check if user-supplied waypoints can be found in the resulting matches
|
||||||
|
if (!parameters.waypoints.empty())
|
||||||
{
|
{
|
||||||
std::set<std::size_t> tidied_waypoints(tidied.parameters.waypoints.begin(),
|
std::set<std::size_t> tidied_waypoints(tidied.parameters.waypoints.begin(),
|
||||||
tidied.parameters.waypoints.end());
|
tidied.parameters.waypoints.end());
|
||||||
@@ -262,6 +263,9 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
|||||||
"NoMatch", "Requested waypoint parameter could not be matched.", json_result);
|
"NoMatch", "Requested waypoint parameter could not be matched.", json_result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// we haven't errored yet, only allow leg collapsing if it was originally requested
|
||||||
|
BOOST_ASSERT(parameters.waypoints.empty() || sub_matchings.size() == 1);
|
||||||
|
const auto collapse_legs = !parameters.waypoints.empty();
|
||||||
|
|
||||||
// each sub_route will correspond to a MatchObject
|
// each sub_route will correspond to a MatchObject
|
||||||
std::vector<InternalRouteResult> sub_routes(sub_matchings.size());
|
std::vector<InternalRouteResult> sub_routes(sub_matchings.size());
|
||||||
@@ -286,7 +290,7 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
|||||||
sub_routes[index] =
|
sub_routes[index] =
|
||||||
algorithms.ShortestPathSearch(sub_routes[index].segment_end_coordinates, {false});
|
algorithms.ShortestPathSearch(sub_routes[index].segment_end_coordinates, {false});
|
||||||
BOOST_ASSERT(sub_routes[index].shortest_path_weight != INVALID_EDGE_WEIGHT);
|
BOOST_ASSERT(sub_routes[index].shortest_path_weight != INVALID_EDGE_WEIGHT);
|
||||||
if (!tidied.parameters.waypoints.empty())
|
if (collapse_legs)
|
||||||
{
|
{
|
||||||
std::vector<bool> waypoint_legs;
|
std::vector<bool> waypoint_legs;
|
||||||
waypoint_legs.reserve(sub_matchings[index].indices.size());
|
waypoint_legs.reserve(sub_matchings[index].indices.size());
|
||||||
|
|||||||
@@ -102,6 +102,19 @@ TurnType::Enum IntersectionHandler::findBasicTurnType(const EdgeID via_edge,
|
|||||||
return TurnType::Turn;
|
return TurnType::Turn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TurnType::Enum IntersectionHandler::areSameClasses(const EdgeID via_edge,
|
||||||
|
const ConnectedRoad &road) const
|
||||||
|
{
|
||||||
|
const auto &in_classes =
|
||||||
|
node_data_container.GetAnnotation(node_based_graph.GetEdgeData(via_edge).annotation_data)
|
||||||
|
.classes;
|
||||||
|
const auto &out_classes =
|
||||||
|
node_data_container.GetAnnotation(node_based_graph.GetEdgeData(road.eid).annotation_data)
|
||||||
|
.classes;
|
||||||
|
|
||||||
|
return in_classes == out_classes;
|
||||||
|
}
|
||||||
|
|
||||||
TurnInstruction IntersectionHandler::getInstructionForObvious(const std::size_t num_roads,
|
TurnInstruction IntersectionHandler::getInstructionForObvious(const std::size_t num_roads,
|
||||||
const EdgeID via_edge,
|
const EdgeID via_edge,
|
||||||
const bool through_street,
|
const bool through_street,
|
||||||
@@ -195,7 +208,8 @@ TurnInstruction IntersectionHandler::getInstructionForObvious(const std::size_t
|
|||||||
if (needs_notification)
|
if (needs_notification)
|
||||||
return {TurnType::Notification, getTurnDirection(road.angle)};
|
return {TurnType::Notification, getTurnDirection(road.angle)};
|
||||||
else
|
else
|
||||||
return {num_roads == 2 ? TurnType::NoTurn : TurnType::Suppressed,
|
return {num_roads == 2 && areSameClasses(via_edge, road) ? TurnType::NoTurn
|
||||||
|
: TurnType::Suppressed,
|
||||||
getTurnDirection(road.angle)};
|
getTurnDirection(road.angle)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,7 +218,7 @@ TurnInstruction IntersectionHandler::getInstructionForObvious(const std::size_t
|
|||||||
{
|
{
|
||||||
return {TurnType::Notification, getTurnDirection(road.angle)};
|
return {TurnType::Notification, getTurnDirection(road.angle)};
|
||||||
}
|
}
|
||||||
if (num_roads > 2)
|
if (num_roads > 2 || !areSameClasses(via_edge, road))
|
||||||
{
|
{
|
||||||
return {TurnType::Suppressed, getTurnDirection(road.angle)};
|
return {TurnType::Suppressed, getTurnDirection(road.angle)};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user