Skip to content

Commit

Permalink
fix(pgr): turf error on some routes (DSR)
Browse files Browse the repository at this point in the history
  • Loading branch information
azarz authored May 7, 2024
1 parent a0c9483 commit e97f915
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/js/sources/pgrSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,11 @@ 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);
}
}
}

Expand Down

0 comments on commit e97f915

Please sign in to comment.