diff --git a/changelog.md b/changelog.md index 6d890e1..fda6a48 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # CHANGELOG +## 2.2.6 +FIXED: +- Ignore turf errors for steps simplification in pgrSource, and add a warning to analyse which steps trigger the error + ## 2.2.5 FEAT: diff --git a/src/js/sources/pgrSource.js b/src/js/sources/pgrSource.js index 5670819..00f02e4 100644 --- a/src/js/sources/pgrSource.js +++ b/src/js/sources/pgrSource.js @@ -1028,7 +1028,12 @@ module.exports = class pgrSource extends Source { // On n'enlève les valeurs dupliquées que si la linestring est plus longue que 2 points if (currentPgrRouteStep.geometry.coordinates.length > 2) { - currentPgrRouteStep.geometry.coordinates = turf.cleanCoords(currentPgrRouteStep.geometry).coordinates + try { + currentPgrRouteStep.geometry.coordinates = turf.cleanCoords(currentPgrRouteStep.geometry).coordinates; + } catch(e) { + LOGGER.warn(e); + LOGGER.warn(currentPgrRouteStep); + } } }