Compare commits

..

4 Commits

Author SHA1 Message Date
Patrick Niklaus 3ef936217f [skip ci] Fix OSRM version 2016-06-24 17:17:34 +02:00
Patrick Niklaus 5bcd00a778 Add changelog entry for current bug fix 2016-06-24 16:32:28 +02:00
Moritz Kobitzsch a6828010ec fix invalid circle centers 2016-06-24 16:31:21 +02:00
Daniel Patterson 17adeeecf5 Fix segfault when route includes very short segments. 2016-06-22 14:55:20 -07:00
7 changed files with 38 additions and 5 deletions
+8
View File
@@ -1,3 +1,11 @@
# 5.2.6
- Bugfixes
- Fix numeric overflow in roundabout center calculation which throws an exception
# 5.2.5
- Bugfixes
- Fixes a segfault caused by incorrect trimming logic for very short steps.
# 5.2.4
Changes from 5.2.3:
- Bugfixes:
+1 -1
View File
@@ -10,7 +10,7 @@ endif()
project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 2)
set(OSRM_VERSION_PATCH 0)
set(OSRM_VERSION_PATCH 6)
# these two functions build up custom variables:
# OSRM_INCLUDE_PATHS and OSRM_DEFINES
+1 -1
View File
@@ -17,7 +17,7 @@ module.exports = function () {
this.setContractArgs(args, callback);
});
this.Given(/^a grid size of (\d+) meters$/, (meters, callback) => {
this.Given(/^a grid size of ([0-9.]+) meters$/, (meters, callback) => {
this.setGridSize(meters);
callback();
});
+15
View File
@@ -24,3 +24,18 @@ Feature: Fixed bugs, kept to check for regressions
When I route I should get
| from | to | route |
| x | y | abc,abc |
Scenario: Step trimming with very short segments
Given a grid size of 0.1 meters
Given the node map
| a | 1 | b | c | d | 2 | e |
Given the ways
| nodes | oneway |
| ab | yes |
| bcd | yes |
| de | yes |
When I route I should get
| from | to | route |
| 1 | 2 | bcd,bcd |
+2 -2
View File
@@ -928,13 +928,13 @@ void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry)
auto &next_to_last_step = *(steps.end() - 2);
// in the end, the situation with the roundabout cannot occur. As a result, we can remove
// all zero-length instructions
if (next_to_last_step.distance <= 1)
if (next_to_last_step.distance <= 1 && steps.size() > 2)
{
geometry.locations.pop_back();
geometry.annotations.pop_back();
geometry.osm_node_ids.pop_back();
geometry.segment_offsets.pop_back();
BOOST_ASSERT(geometry.segment_distances.back() < 1);
BOOST_ASSERT(geometry.segment_distances.back() <= 1);
geometry.segment_distances.pop_back();
next_to_last_step.maneuver.waypoint_type = WaypointType::Arrive;
+4 -1
View File
@@ -258,7 +258,10 @@ circleCenter(const Coordinate C1, const Coordinate C2, const Coordinate C3)
C2C1_slope * (C2_x + C3_x)) /
(2 * (C3C2_slope - C2C1_slope));
const double lat = (0.5 * (C1_x + C2_x) - lon) / C2C1_slope + 0.5 * (C1_y + C2_y);
return Coordinate(FloatLongitude(lon), FloatLatitude(lat));
if (lon < -180.0 || lon > 180.0 || lat < -90.0 || lat > 90.0)
return boost::none;
else
return Coordinate(FloatLongitude(lon), FloatLatitude(lat));
}
}
@@ -302,6 +302,13 @@ BOOST_AUTO_TEST_CASE(circleCenter)
c = Coordinate(FloatLongitude(-112.096419), FloatLatitude(41.147259));
result = coordinate_calculation::circleCenter(a, b, c);
BOOST_CHECK(!result);
// Out of bounds
a = Coordinate(FloatLongitude(-112.096234), FloatLatitude(41.147258));
b = Coordinate(FloatLongitude(-112.106606), FloatLatitude(41.147259));
c = Coordinate(FloatLongitude(-113.096419), FloatLatitude(41.147258));
result = coordinate_calculation::circleCenter(a, b, c);
BOOST_CHECK(!result);
}
BOOST_AUTO_TEST_SUITE_END()