Fix distance calculation consistency. (#6315)

Consolidate great circle distance calculations to use cheap ruler library.
This commit is contained in:
Siarhei Fedartsou
2022-08-19 23:31:40 +02:00
committed by GitHub
parent 8f0cd5cf7b
commit aadc088084
84 changed files with 780 additions and 683 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ exports.three_test_coordinates = [[7.41337, 43.72956],
exports.two_test_coordinates = exports.three_test_coordinates.slice(0, 2)
exports.test_tile = {'at': [17059, 11948, 15], 'size': 156624};
exports.test_tile = {'at': [17059, 11948, 15], 'size': 156539};
// Test files generated by the routing engine; check test/data
if (process.env.OSRM_DATA_PATH !== undefined) {
+1 -1
View File
@@ -708,6 +708,6 @@ test('route: snapping parameter passed through OK', function(assert) {
var osrm = new OSRM(monaco_path);
osrm.route({snapping: "any", coordinates: [[7.448205209414596,43.754001097311544],[7.447122039202185,43.75306156811368]]}, function(err, route) {
assert.ifError(err);
assert.equal(Math.round(route.routes[0].distance * 10), 1314); // Round it to nearest 0.1m to eliminate floating point comparison error
assert.equal(Math.round(route.routes[0].distance * 10), 1315); // Round it to nearest 0.1m to eliminate floating point comparison error
});
});