Commit da5450f
committed
fix: update TripAndShapeDistanceValidator to ignore shape with no shape_dist_traveled (#2018)
Some GTFS feeds do not provide shape_dist_traveled in shapes.txt
In this case, the value is set to 0 in the code, so sorting shapes based
on ShapeDistTraveled does not work and usually returns the first shape
row.
It leads to an error, the first shape of the shape is usually very far
away from the last stop of the trips following the shape.
We can assume the biggest shape_dist_traveled of a given shape should
never be 0, otherwise it means the value is not set. In this case, we
return early to ensure no validation error will be issued.
Fixes #20181 parent f1174bd commit da5450f
File tree
2 files changed
+23
-0
lines changed- main/src
- main/java/org/mobilitydata/gtfsvalidator/validator
- test/java/org/mobilitydata/gtfsvalidator/validator
2 files changed
+23
-0
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| |||
main/src/test/java/org/mobilitydata/gtfsvalidator/validator/TripAndShapeDistanceValidatorTest.java
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
111 | 129 | | |
112 | 130 | | |
113 | 131 | | |
| |||
0 commit comments