Skip to content

Commit

Permalink
Fix #84. NPE validating GTFS w/ shapepoint at 0,0.
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentg committed Nov 28, 2024
1 parent abcd447 commit b52f19d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ private ProjectedShapePatternImpl computePatternIndex(GtfsTrip trip,
.getPointsOfShape(trip.getShapeId());

ProjectedShapePatternImpl ret;
if (trip.getShapeId() == null || shapePoints.size() < 2) {
// No shape, linear index on inter-stop distance
if (trip.getShapeId() == null || shapePoints.size() < 2
|| shapePoints.stream().anyMatch(
p -> p == null || p.getCoordinates() == null)) {
// No shape or broken, linear index on inter-stop distance
ret = computeShapelessPatternIndex(trip, stopTimes, dao);
} else {
// A shape is present, check shape_dist_traveled
Expand Down

0 comments on commit b52f19d

Please sign in to comment.