MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
278 stars 100 forks source link

too_fast_travel notice raised for high speed rail services #931

Closed naxxfish closed 3 years ago

naxxfish commented 3 years ago

Bug report

Describe the bug The threshold of 150 km/hr for raising the too_fast_travel notice is slower than many rail services around the world, many of which travel in excess of 350 km/hr (e.g. Shinkansen in Japan at 320 km/hr, HS2 350km/hr in the UK).

However, it is generally accepted that bus or ferry services do not travel this fast. It may be useful to convert this notice into mode specific notices which are appropriate for those kinds of vehicles.

How we reproduce the bug Steps to reproduce the behaviour:

  1. Find a GTFS with a valid rail schedule for the UK
  2. Run the validator
  3. See too_fast_travel errors in the report

Expected behaviour Only show too_fast_travel notices when the data is invalid, not when the service is operating as expected.

Observed behaviour Services which run at high speeds between stops are flagged as having too_fast_travel notices.

Current Workaround Filter out notices that are generated for known high speed routes, where the speed is slower than the running speed of the route.

Screenshots: Visual examples can help us better understand the issue.

Environment versions

lionel-nj commented 3 years ago

Hi @naxxfish, thanks for opening the issue and helping us build a better tool. To help the conversation move forward, could you provide the link or the zip file of the dataset you tried to validate, please?

naxxfish commented 3 years ago

Hi - here is a sample GTFS for ICE trains in Germany.

I can't provide the GTFS I was validating against, but this one illustrates the problem. ICE trains have a top speed of 300kmph, so flagging warnings when they travel above 150kmph is unhelpful.

Here is a GTFS for UK rail services that raise this warning consistently' gb-rail-latest.zip (1766 notices of type too_fast_travel)

aababilov commented 3 years ago

This is a very fair point. The Google implementation of travel speed validation is using different threshold depending on vehicle type.

private static double getMaxVehicleSpeed(RouteType.BasicType routeType) {
    switch (routeType) {
      case LIGHT_RAIL:
        return 100;
      case RAIL:
        return 300;
      case SUBWAY:
      case MONORAIL:
      case BUS:
      case TROLLEYBUS:
        return 150;
      case FERRY:
        return 80;
      case HORSE_CARRIAGE:
        return 75;
      default:
        return 50;
    }
  }

We at Google plan to open-source our travel speed validation and replace the current upstream one.

naxxfish commented 3 years ago

Interestingly the max speeds in your snippet @aababilov for rail - assuming they are kmph - are still too slow for the very high speed services that reach even as fast as 350 kmph - although it's unlikely they would sustain top speed for the whole duration between stops, it's still a relatively small safety margin for false positives compared to 150kmph subway/monorail/bus/trolleybus.