Skip to content

Adjust the maximum allowed speed in our stop time validator to be consistent with MobilityData GTFS validator #6606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev-2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,21 @@ private boolean filterStopTimes(List<StopTime> stopTimes) {
}

private double getMaxSpeedForMode(TransitMode mode) {
return switch (mode) {
// 1000 km/h
case AIRPLANE -> 280;
// 250 km/h
case RAIL -> 70;
// max in the world is 9 m/s for gondolas, 6 m/s for funiculars
case GONDOLA, FUNICULAR -> 10;
// 108km/h
default -> 30;
};
// The following numbers (except airplane) are copied from the GTFS validator
// https://github.com/MobilityData/gtfs-validator/blob/master/main/src/main/java/org/mobilitydata/gtfsvalidator/validator/StopTimeTravelSpeedValidator.java#L310
return (
switch (mode) {
case AIRPLANE -> 1000;
case TRAM -> 100;
case RAIL -> 500;
case SUBWAY, MONORAIL, BUS, TROLLEYBUS, COACH -> 150;
case FERRY -> 80;
case CABLE_CAR -> 30;
case GONDOLA, FUNICULAR -> 50;
default -> 200;
} /
3.6
);
}

/**
Expand Down
Loading