Concatenate total track

+ handle server voicehint time removed, times with 3 digits
This commit is contained in:
Norbert Renner 2021-03-12 21:20:35 +01:00
parent 954812cf52
commit 25f8828ae7
10 changed files with 412 additions and 47 deletions

View file

@ -47,6 +47,11 @@ describe('voice hints', () => {
let brouterGpx = read('2-locus.gpx');
brouterGpx = brouterGpx.replace(/.0<\/locus:rteDistance/g, '</locus:rteDistance'); // ignore .0 decimal
brouterGpx = brouterGpx.replace(/\n\s*<\/extensions>\n\s*<extensions>/, ''); // ignore (invalid) double tag
// ignore float rounding differences
brouterGpx = brouterGpx.replace(
/:(rteTime|rteSpeed)>([\d.]*)<\//g,
(match, p1, p2) => `:${p1}>${(+p2).toFixed(3)}</`
);
const gpx = BR.Gpx.format(geoJson, 2);
expect(gpx).toEqual(brouterGpx);

View file

@ -13,8 +13,8 @@
"total-energy": "4412",
"cost": "533",
"voicehints": [
[1,5,0,140.0,24.90994644165039,89," 6(90)6 (0)6 (-89)2"],
[5,2,0,90.0,9.614852905273438,-90," 6(-89)6 (0)6 (89)6"]
[1,5,0,140.0,89," 6(90)6 (0)6 (-89)2"],
[5,2,0,90.0,-90," 6(-89)6 (0)6 (89)6"]
],
"messages": [
["Longitude", "Latitude", "Elevation", "Distance", "CostPerKm", "ElevCost", "TurnCost", "NodeCost", "InitialCost", "WayTags", "NodeTags"],