To put it all short:
With the existing implementation, everything works just fine as long as none of the coordinates are repeated in the input waypoints data:
[7.137154, 49.319755], // 1
[7.148604, 49.315962], // 2
[7.149873, 49.319595],
[7.140321, 49.30794],
[7.153934, 49.317662],
[7.144149, 49.310097], // 3
[7.13242, 49.31679],
[7.146392, 49.317763], // 4
[7.156454, 49.322832], // 5
[7.143664, 49.313397], // 6
// [7.137154, 49.319755], // 1
// [7.146392, 49.317763], // 4
// [7.137154, 49.319755], // 1
// [7.148604, 49.315962], // 2
// [7.144149, 49.310097], // 3
// [7.143664, 49.313397], // 6
// [7.156454, 49.322832], // 5
// [7.143664, 49.313397], // 6
Total route geometry:
iw_lHk~pj@sCkIw@qFj@gUbAk@fJuN~AhAzAcF?yApGiCRgAYkCK}Hg@aDEsCVcBcEiA_BmEsBrD?`B`CtGpDfFAlHiCnFmB`CqFgJ?_AmAaC_EoC_C^`H~PtJpHzAcF?yApGiCRgA[}Cl@@^cA`AMp@|DzAvArBT`DhJfEfInIxKhEpL|CpFdFrMZHbEiD_B_C}D}Ic`@qy@wAmNe@YmA^oCKkD_CqFqAu@u@a@^cBkCx@eAXhAfB|CpFpAjD~BnCJ~@t@nAvLz@ExRla@j@lAwEtG{BxO}@dR@zHu@nMcCzHe@pPWLeBw@k@|DoEnDoENqBjAi@ye@_A}g@Ri]k@qEoAyCeA_A^qA`AcDKcBsAxAaBtDyFcEeBuC_HmRk@oDQ_Gy@oDgBgCiBk@IaDNo@fAi@C[y@{C}BiC|BhCz@hDmAfA@`EhBj@fBfCx@nDP~Fj@nD~GlRhApBtJpHzAcF?yApGiCRgA[}Cl@@^cA`AMp@|DzAvArBT`DhJfEfI`DjEkApEkGqF]LEr@
Reference Valhalla:
Issues begin with uncommenting at least the 11th coordinate (which duplicates the first one):
[7.137154, 49.319755], // 1
[7.148604, 49.315962], // 2
[7.149873, 49.319595],
[7.140321, 49.30794],
[7.153934, 49.317662],
[7.144149, 49.310097], // 3
[7.13242, 49.31679],
[7.146392, 49.317763], // 4
[7.156454, 49.322832], // 5
[7.143664, 49.313397], // 6
[7.137154, 49.319755], // 1
// [7.146392, 49.317763], // 4
// [7.137154, 49.319755], // 1
// [7.148604, 49.315962], // 2
// [7.144149, 49.310097], // 3
// [7.143664, 49.313397], // 6
// [7.156454, 49.322832], // 5
// [7.143664, 49.313397], // 6
The built route looks the same
Though the total route's geometry's different:
iw_lHk~pj@sCkIw@qFj@gUbAk@fJuN~AhAzAcF?yApGiCRgAYkCK}Hg@aDEsCVcBcEiA_BmEsBrD?`B`CtGpDfFAlHiCnFmB`CqFgJ?_AmAaC_EoC_C^`H~PtJpHzAcF?yApGiCRgA[}Cl@@^cA`AMp@|DzAvArBT`DhJfEfInIxKhEpL|CpFdFrMZHbEiD_B_C}D}Ic`@qy@wAmNe@YmA^oCKkD_CqFqAu@u@a@^cBkCx@eAXhAfB|CpFpAjD~BnCJ~@t@nAvLz@ExRla@j@lAwEtG{BxO}@dR@zHu@nMcCzHe@pPWLeBw@k@|DoEnDoENqBjAi@ye@_A}g@Ri]k@qEoAyCeA_A^qA`AcDKcBsAxAaBtDyFcEeBuC_HmRk@oDQ_Gy@oDgBgCiBk@IaDNo@fAi@C[y@{C}BiC|BhCz@hDmAfA@`EhBj@fBfCx@nDP~Fj@nD~GlRhApBtJpHzAcF?yApGiCRgA[}Cl@@^cA`AMp@|DzAvArBT`DhJfEfI`DjEkApEkGqF]LEr@Sh@L|F`CvPjF_A}@dR@zHu@nMcCzHe@pPWLeBw@k@|DoEnDoENqBjAwAm_AeFfAwCdDaA`@WqDsA_F
What it should look like (ref)
If we uncomment all the waypoints, thus adding multiple duplicated waypoints, here's what the difference looks like:
Real: total mess with some weird straight lines here and there
Ref