Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ef936217f | |||
| 5bcd00a778 | |||
| a6828010ec |
@@ -1,3 +1,7 @@
|
|||||||
|
# 5.2.6
|
||||||
|
- Bugfixes
|
||||||
|
- Fix numeric overflow in roundabout center calculation which throws an exception
|
||||||
|
|
||||||
# 5.2.5
|
# 5.2.5
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
- Fixes a segfault caused by incorrect trimming logic for very short steps.
|
- Fixes a segfault caused by incorrect trimming logic for very short steps.
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ endif()
|
|||||||
project(OSRM C CXX)
|
project(OSRM C CXX)
|
||||||
set(OSRM_VERSION_MAJOR 5)
|
set(OSRM_VERSION_MAJOR 5)
|
||||||
set(OSRM_VERSION_MINOR 2)
|
set(OSRM_VERSION_MINOR 2)
|
||||||
set(OSRM_VERSION_PATCH 5)
|
set(OSRM_VERSION_PATCH 6)
|
||||||
|
|
||||||
# these two functions build up custom variables:
|
# these two functions build up custom variables:
|
||||||
# OSRM_INCLUDE_PATHS and OSRM_DEFINES
|
# OSRM_INCLUDE_PATHS and OSRM_DEFINES
|
||||||
|
|||||||
@@ -258,6 +258,9 @@ circleCenter(const Coordinate C1, const Coordinate C2, const Coordinate C3)
|
|||||||
C2C1_slope * (C2_x + C3_x)) /
|
C2C1_slope * (C2_x + C3_x)) /
|
||||||
(2 * (C3C2_slope - C2C1_slope));
|
(2 * (C3C2_slope - C2C1_slope));
|
||||||
const double lat = (0.5 * (C1_x + C2_x) - lon) / C2C1_slope + 0.5 * (C1_y + C2_y);
|
const double lat = (0.5 * (C1_x + C2_x) - lon) / C2C1_slope + 0.5 * (C1_y + C2_y);
|
||||||
|
if (lon < -180.0 || lon > 180.0 || lat < -90.0 || lat > 90.0)
|
||||||
|
return boost::none;
|
||||||
|
else
|
||||||
return Coordinate(FloatLongitude(lon), FloatLatitude(lat));
|
return Coordinate(FloatLongitude(lon), FloatLatitude(lat));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,6 +302,13 @@ BOOST_AUTO_TEST_CASE(circleCenter)
|
|||||||
c = Coordinate(FloatLongitude(-112.096419), FloatLatitude(41.147259));
|
c = Coordinate(FloatLongitude(-112.096419), FloatLatitude(41.147259));
|
||||||
result = coordinate_calculation::circleCenter(a, b, c);
|
result = coordinate_calculation::circleCenter(a, b, c);
|
||||||
BOOST_CHECK(!result);
|
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()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|||||||
Reference in New Issue
Block a user