Skip to content

Commit 9069468

Browse files
authored
Merge pull request #106 from IGNF/develop
fix(pgr): turf error on some routes (DSR) (#105)
2 parents 81b9ad1 + 64f43ba commit 9069468

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 2.2.6
4+
FIXED:
5+
- Ignore turf errors for steps simplification in pgrSource, and add a warning to analyse which steps trigger the error
6+
37
## 2.2.5
48

59
FEAT:

src/js/sources/pgrSource.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,12 @@ module.exports = class pgrSource extends Source {
10281028

10291029
// On n'enlève les valeurs dupliquées que si la linestring est plus longue que 2 points
10301030
if (currentPgrRouteStep.geometry.coordinates.length > 2) {
1031-
currentPgrRouteStep.geometry.coordinates = turf.cleanCoords(currentPgrRouteStep.geometry).coordinates
1031+
try {
1032+
currentPgrRouteStep.geometry.coordinates = turf.cleanCoords(currentPgrRouteStep.geometry).coordinates;
1033+
} catch(e) {
1034+
LOGGER.warn(e);
1035+
LOGGER.warn(currentPgrRouteStep);
1036+
}
10321037
}
10331038
}
10341039

0 commit comments

Comments
 (0)