Compare commits

...

7 Commits

Author SHA1 Message Date
Patrick Niklaus c7293f2024 Bump version to 5.7.2 2017-05-24 16:49:03 +00:00
Patrick Niklaus ddc8aed25d Fix formating 2017-05-24 16:47:14 +00:00
Michael Krasnyk 5f7410057c Fix OSRM_ASSERT_MSG compilation fail in Release mode 2017-05-24 16:36:21 +00:00
Patrick Niklaus d55d46e64e Add missing header after cherry-pick 2017-05-24 16:14:06 +00:00
Michael Krasnyk a83150d311 Place reverse entering_via_edge in the front of intersection_view 2017-05-24 15:52:00 +00:00
Michael Krasnyk b073bf36f3 Added example for roundabout overlapping 2017-05-24 15:47:58 +00:00
Daniel J. Hofmann aaea94f776 Asserts Valid Iterators in Roundabout Exit Invalidation, see #4024 2017-05-24 15:44:28 +00:00
7 changed files with 64 additions and 11 deletions
+5
View File
@@ -1,3 +1,8 @@
# 5.7.2
- Changes from 5.7.1:
- Bug fixes:
- Fixes segmentation fault caused by the fix for 3977
# 5.7.1
- Changes from 5.7.0:
- Bug fixes:
+1 -1
View File
@@ -55,7 +55,7 @@ endif()
project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 7)
set(OSRM_VERSION_PATCH 1)
set(OSRM_VERSION_PATCH 2)
set(OSRM_VERSION "${OSRM_VERSION_MAJOR}.${OSRM_VERSION_MINOR}.${OSRM_VERSION_PATCH}")
add_definitions(-DOSRM_PROJECT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
+26
View File
@@ -794,3 +794,29 @@ Feature: Basic Roundabout
| 1 | f | abcda,af,af | depart,roundabout-exit-1,arrive |
| 1 | g | abcda,bg,bg | depart,roundabout-exit-1,arrive |
| 1 | h | abcda,bh,bh | depart,roundabout-exit-1,arrive |
Scenario: CCW and CW roundabouts with overlaps
Given the node map
"""
a d g h
b c j i
f e k l
"""
And the ways
| nodes | highway | junction |
| abcda | tertiary | roundabout |
| ed | tertiary | |
| af | tertiary | |
| ghijg | tertiary | roundabout |
| kg | tertiary | |
| hl | tertiary | |
When I route I should get
| from | to | route | turns | distance |
| e | f | ed,af,af | depart,roundabout-exit-1,arrive | 80.1m |
| f | e | af,ed,ed | depart,roundabout-exit-1,arrive | 120.1m |
| k | l | kg,hl,hl | depart,roundabout-exit-1,arrive | 80.1m |
| l | k | hl,kg,kg | depart,roundabout-exit-1,arrive | 120.1m |
+3 -3
View File
@@ -34,9 +34,9 @@
#define OSRM_ASSERT_MSG(cond, coordinate, msg) \
do \
{ \
(void)cond; \
(void)coordinate; \
(void)msg; \
(void)(cond); \
(void)(coordinate); \
(void)(msg); \
} while (0)
#define OSRM_ASSERT(cond, coordinate) OSRM_ASSERT_MSG(cond, coordinate, "")
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "osrm",
"version": "5.7.1",
"version": "5.7.2",
"private": false,
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
"dependencies": {
@@ -3,6 +3,7 @@
#include "extractor/geojson_debug_policies.hpp"
#include "util/geojson_debug_logger.hpp"
#include "util/assert.hpp"
#include "util/bearing.hpp"
#include "util/coordinate_calculation.hpp"
#include "util/log.hpp"
@@ -278,7 +279,8 @@ IntersectionView IntersectionGenerator::TransformIntersectionShapeIntoView(
};
// due to merging of roads, the u-turn might actually not be part of the intersection anymore
const auto uturn_bearing = [&]() {
// uturn is a pair of {edge id, bearing}
const auto uturn = [&]() {
const auto merge_entry = std::find_if(
performed_merges.begin(), performed_merges.end(), [&uturn_edge_itr](const auto entry) {
return entry.merged_eid == uturn_edge_itr->eid;
@@ -291,7 +293,8 @@ IntersectionView IntersectionGenerator::TransformIntersectionShapeIntoView(
normalized_intersection.end(),
[&](const IntersectionShapeData &road) { return road.eid == merged_into_id; });
BOOST_ASSERT(merged_u_turn != normalized_intersection.end());
return util::bearing::reverse(merged_u_turn->bearing);
return std::make_pair(merged_u_turn->eid,
util::bearing::reverse(merged_u_turn->bearing));
}
else
{
@@ -301,7 +304,9 @@ IntersectionView IntersectionGenerator::TransformIntersectionShapeIntoView(
connect_to_previous_node);
BOOST_ASSERT(uturn_edge_at_normalized_intersection_itr !=
normalized_intersection.end());
return util::bearing::reverse(uturn_edge_at_normalized_intersection_itr->bearing);
return std::make_pair(
uturn_edge_at_normalized_intersection_itr->eid,
util::bearing::reverse(uturn_edge_at_normalized_intersection_itr->bearing));
}
}();
@@ -314,7 +319,7 @@ IntersectionView IntersectionGenerator::TransformIntersectionShapeIntoView(
return IntersectionViewData(
road,
is_allowed_turn(road),
util::bearing::angleBetween(uturn_bearing, road.bearing));
util::bearing::angleBetween(uturn.second, road.bearing));
});
const auto uturn_edge_at_intersection_view_itr =
@@ -369,8 +374,22 @@ IntersectionView IntersectionGenerator::TransformIntersectionShapeIntoView(
std::end(intersection_view),
std::mem_fn(&IntersectionViewData::CompareByAngle));
BOOST_ASSERT(intersection_view[0].angle >= 0. &&
intersection_view[0].angle < std::numeric_limits<double>::epsilon());
// Move entering_via_edge to intersection front and place all roads prior entering_via_edge
// at the end of the intersection view with 360° angle
auto entering_via_it = std::find_if(intersection_view.begin(),
intersection_view.end(),
[&uturn](auto &road) { return road.eid == uturn.first; });
OSRM_ASSERT(entering_via_it != intersection_view.end() && entering_via_it->angle >= 0. &&
entering_via_it->angle < std::numeric_limits<double>::epsilon(),
coordinates[node_at_intersection]);
if (entering_via_it != intersection_view.begin() && entering_via_it != intersection_view.end())
{
std::for_each(
intersection_view.begin(), entering_via_it, [](auto &road) { road.angle = 360.; });
std::rotate(intersection_view.begin(), entering_via_it, intersection_view.end());
}
return intersection_view;
}
@@ -1,6 +1,7 @@
#include "extractor/guidance/roundabout_handler.hpp"
#include "extractor/guidance/constants.hpp"
#include "util/assert.hpp"
#include "util/bearing.hpp"
#include "util/coordinate_calculation.hpp"
#include "util/guidance/name_announcements.hpp"
@@ -158,6 +159,8 @@ void RoundaboutHandler::invalidateExitAgainstDirection(const NodeID from_nid,
}
}
OSRM_ASSERT(invalidate_from <= invalidate_to, coordinates[from_nid]);
// Exiting roundabouts at an entry point is technically a data-modelling issue.
// This workaround handles cases in which an exit precedes and entry. The resulting
// u-turn against the roundabout direction is invalidated.