Revert "Improve speed of Map Matching" (#5196)
* Revert "Update changelog" This reverts commit9b779c704f. * Revert "Fix formating" This reverts commit5bd7d04fe3. * Revert "Fix bug in computation of distance offset for phantom node" This reverts commit0f78f7b2cc. * Revert "Adjust text cases for flightly different matching due to rounding" This reverts commit8473be69d2. * Revert "Round network distance to deci-meter to retain previous behavior" This reverts commitc0124f7d77. * Revert "Preserve heap state in map matching" This reverts commitb630b4e32a. * Revert "Use distance functions from many to many" This reverts commit89fabc1b9c. * Revert "Use FCC algorithm for map matching distance calculation" This reverts commita649a8a5cf.
This commit is contained in:
@@ -22,11 +22,6 @@ namespace coordinate_calculation
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
// earth radius varies between 6,356.750-6,378.135 km (3,949.901-3,963.189mi)
|
||||
// The IUGG value for the equatorial radius is 6378.137 km (3963.19 miles)
|
||||
const constexpr double EARTH_RADIUS = 6372797.560856;
|
||||
|
||||
class CheapRulerContainer
|
||||
{
|
||||
public:
|
||||
@@ -117,7 +112,7 @@ double haversineDistance(const Coordinate coordinate_1, const Coordinate coordin
|
||||
const double aharv = std::pow(std::sin(dlat / 2.0), 2.0) +
|
||||
std::cos(dlat1) * std::cos(dlat2) * std::pow(std::sin(dlong / 2.), 2);
|
||||
const double charv = 2. * std::atan2(std::sqrt(aharv), std::sqrt(1.0 - aharv));
|
||||
return EARTH_RADIUS * charv;
|
||||
return detail::EARTH_RADIUS * charv;
|
||||
}
|
||||
|
||||
double greatCircleDistance(const Coordinate coordinate_1, const Coordinate coordinate_2)
|
||||
@@ -138,7 +133,7 @@ double greatCircleDistance(const Coordinate coordinate_1, const Coordinate coord
|
||||
|
||||
const double x_value = (float_lon2 - float_lon1) * std::cos((float_lat1 + float_lat2) / 2.0);
|
||||
const double y_value = float_lat2 - float_lat1;
|
||||
return std::hypot(x_value, y_value) * EARTH_RADIUS;
|
||||
return std::hypot(x_value, y_value) * detail::EARTH_RADIUS;
|
||||
}
|
||||
|
||||
double perpendicularDistance(const Coordinate segment_source,
|
||||
|
||||
Reference in New Issue
Block a user