Skip to content

Commit

Permalink
fix: validator error
Browse files Browse the repository at this point in the history
  • Loading branch information
cka-y committed Feb 19, 2024
1 parent 688b807 commit 1b99140
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ public void validate(NoticeContainer noticeContainer) {
double maxShapeDist = maxShape.shapeDistTraveled();
double distanceInMeters =
getDistanceMeters(maxShape.shapePtLatLon(), stop.stopLatLon());
if (distanceInMeters > DISTANCE_THRESHOLD) {
noticeContainer.addValidationNotice(
new TripDistanceExceedsShapeDistanceNotice(
trip.tripId(), shapeId, maxStopTimeDist, maxShapeDist, distanceInMeters));
} else if (distanceInMeters > 0) {
noticeContainer.addValidationNotice(
new TripDistanceExceedsShapeDistanceWarningNotice(
trip.tripId(), shapeId, maxStopTimeDist, maxShapeDist, distanceInMeters));
if (maxStopTimeDist > maxShapeDist) {
if (distanceInMeters > DISTANCE_THRESHOLD) {
noticeContainer.addValidationNotice(
new TripDistanceExceedsShapeDistanceNotice(
trip.tripId(), shapeId, maxStopTimeDist, maxShapeDist, distanceInMeters));
} else if (distanceInMeters > 0) {
noticeContainer.addValidationNotice(
new TripDistanceExceedsShapeDistanceWarningNotice(
trip.tripId(), shapeId, maxStopTimeDist, maxShapeDist, distanceInMeters));
}
}
});
}
Expand Down

0 comments on commit 1b99140

Please sign in to comment.