Sample GTFS/GTFS Realtime datasets for software testing

827 views
Skip to first unread message

Sean Barbeau

unread,
Mar 3, 2022, 5:51:12 PM3/3/22
to Transit Developers
Hi all,
Have anyone created a set of sample GTFS or GTFS Realtime datasets used for software unit tests that are publicly shared?

An example of what I'm referring to:

The general idea is to have a sample GTFS dataset that doesn't change, and that models certain conditions (e.g., common errors), so you know that when you make code changes (e.g., in a validator) your expected output is consistent.

Thanks,
Sean

Sean Barbeau
Center for Urban Transportation Research
University of South Florida

Tom Brown

unread,
Mar 21, 2022, 8:27:03 PM3/21/22
to transit-d...@googlegroups.com
Hi Sean,
https://github.com/google/transitfeed/tree/masteSorry for theSorry for ther/tests/data hasn't been updated much in many years but seems close to what you want for static GTFS. Sorry for my slow reply. I'm not working with transit data any longer but lurking. Thank you for your ongoing effort!
Tom

--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to transit-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/transit-developers/21ea294c-52d5-496c-ba44-985768b2b431n%40googlegroups.com.

Sean Barbeau

unread,
Mar 22, 2022, 10:01:09 AM3/22/22
to Transit Developers
Thanks Tom!

For anyone interested, I'm tracking these here on the awesome-transit list:

Sean Barbeau

unread,
Mar 22, 2022, 3:33:28 PM3/22/22
to Transit Developers
From Drew @ Interline (for some reason his reply was never posted):

Hi Sean,

 

Yes, we use this type of approach for testing the transitland-lib library that handles GTFS and GTFS Realtime parsing and validation for Transitland:

 

There are test case feeds for all three levels of GTFS static validation:

 

1. "bad entities" at the single row level: https://github.com/interline-io/transitland-lib/tree/master/test/data/bad-entities

 

2. validation errors that that involve entities in one or more files: https://github.com/interline-io/transitland-lib/tree/master/test/data/validator/errors

 

3. best practices: https://github.com/interline-io/transitland-lib/tree/master/test/data/validator/best-practiceshttps://github.com/interline-io/transitland-lib/tree/master/test/data/validator/best-practices

 

You'll notice that it's just the relevant files in each directory for each test case. At the time of running the test, the tooling injects the rest of the feed files that are needed to make the feed complete. In theory, the tooling could be expanded to also generate full feed archives for external use.

 

For GTFS Realtime, we create test cases in JSON and turn them into PB contents in the test rig. Much less coverage for that so far — it's mainly for testing matching logic: https://github.com/interline-io/transitland-server/tree/main/test/data/rt

 Drew

Anish Pk

unread,
Nov 28, 2022, 12:31:37 PM11/28/22
to Transit Developers

Hi I am facing problem in parsing the GTFS file using java. Sharing the sample text file can you please help me the way forward?

header {
  gtfs_realtime_version: "1.0"
  incrementality: FULL_DATASET
  timestamp: 1668402797
}
entity {
  id: "0"
  vehicle {
    trip {
      trip_id: "54967"
      route_id: "07263"
    }
    position {
      latitude: 25.194374
      longitude: 51.467148
      speed: 0.0
    }
    current_stop_sequence: 15
    current_status: IN_TRANSIT_TO
    congestion_level: STOP_AND_GO
    stop_id: "47027"
    vehicle {
      id: "00750"
      label: "0|0|0|3||0|1|0|1"
      license_plate: "7335"
    }
  }
}
entity {
  id: "1"
  vehicle {
    trip {
      trip_id: "550554"
      route_id: "454545"
    }
    position {
      latitude: 25.15584
      longitude: 51.45545
      speed: 0.0
    }
    current_stop_sequence: 1
    current_status: IN_TRANSIT_TO
    congestion_level: STOP_AND_GO
    stop_id: "48500"
    vehicle {
      id: "00736"
      label: "0|0|0|3||0|1|0|1"
      license_plate: "11233"
    }
  }
}

Sean Barbeau

unread,
Dec 7, 2022, 11:27:45 AM12/7/22
to Transit Developers
You'll need the protocol buffer version of the feed - you can learn more about that here:

Then you can use one of the open source tools here to load the GTFS and GTFS real-time data:

Sean

Anish Pk

unread,
Dec 8, 2022, 3:07:57 AM12/8/22
to Transit Developers
Thanks for the support
Reply all
Reply to author
Forward
0 new messages