Awesome
GTFS Realtime Validator
A tool that validates General Transit Feed Specification (GTFS)-realtime feeds
<img src="https://cloud.githubusercontent.com/assets/928045/25874575/2afaa3b0-34e1-11e7-92a4-b0a68f233748.png" width="1000">Read more in this Medium article.
Questions? You can open an issue, ask the MobilityData Slack Group or reach out to the GTFS Realtime Google Group.
Quick start - Run it yourself
Please note that this project is still under active development and is in an early alpha state.
Prerequisites
Run the webapp
- Download the latest webapp snapshot jar of the validator from the webapp package.
- From the command line run
java -jar {JAR file name}
, where{JAR file name}
is the name of the file you downloaded in the previous step. For example, if the JAR file name isgtfs-realtime-validator-webapp-1.0.0-20220223.003109-1.jar
, you would runjava -jar gtfs-realtime-validator-webapp-1.0.0-20220223.003109-1.jar
. - When prompted, in your browser go to
http://localhost:8080
- Enter your General Transit Feed Specification (GTFS)-realtime and GTFS feed URLs and click "Start". Example feeds:
- HART (Tampa, FL)
- GTFS Realtime - http://api.tampa.onebusaway.org:8088/trip-updates
- GTFS - http://gohart.org/google/google_transit.zip
- MBTA (Boston, MA)
- GTFS Realtime - https://cdn.mbta.com/realtime/TripUpdates.pb
- GTFS - https://cdn.mbta.com/MBTA_GTFS.zip
- ...more at OpenMobilityData.org
- HART (Tampa, FL)
Run batch validation
See the batch processing section of the gtfs-realtime-validator-lib README.
Rules
Have a suggestion for a new rule? Open an issue with the "new rule" label. You can see the complete process for adding new rules on the Adding new rules page.
Building the project
There are two components to this project:
- gtfs-realtime-validator-lib - The core library that implements GTFS Realtime validation rules as well as batch processing mode. You can use this same library in your own project.
- gtfs-realtime-validator-webapp - A server and website that allows multiple users to validate GTFS-relatime feeds by simply entering URLs into the website.
The main gtfs-realtime-validator-webapp user interface is implemented as a web application, with the backend code written in Java. An instance of the Jetty embedded server is used to run the application, with Hibernate used for data persistence.
Prerequisites
Following are the requirements to build and run the project from source code:
1. Build the project
From the command-line, run:
mvn package
This will generate an executable file in the gtfs-realtime-validator-webapp/target/
directory with all the dependencies needed to run the web application.
Note that this might take a while - this project also builds and packages the gtfs-validator so a static GTFS validation report can be seen within the GTFS-rt validator tool.
If you're going to be rebuilding the project frequently (e.g., editing source code), we suggest you load the project as Maven project in an IDE like IntelliJ or Netbeans.
2. Run the application
To start up the server so you can view the web interface, from the command-line, run:
java -jar {JAR file name}
, where{JAR file name}
is the name of the file you downloaded previously. For example, if the JAR file name isgtfs-realtime-validator-webapp-1.0.0-20220223.003109-1.jar
, you would runjava -jar gtfs-realtime-validator-webapp-1.0.0-20220223.003109-1.jar
.
You should see some output, and a message saying Go to http://localhost:8080 in your browser
.
3. View the application
Once the application has been started, you can enter URLs for the feeds you'd like to have validated at:
Configuration options
See our Configuration Guide for various configuration options, including changing the port number that the server runs on, what database it connects to, and more.
Note that the validator also has a batch processing mode - see the gtfs-realtime-validator-lib README.
Docker
Setup
- Download and install Docker
docker pull ghcr.io/mobilitydata/gtfs-realtime-validator
to get the latest snapshot version of the validator. You can look at other Docker images for this project here.
Or, build the image yourself using the following:
docker build -t gtfs-realtime-validator .
Run
docker run -p 8080:8080 ghcr.io/mobilitydata/gtfs-realtime-validator
Then go to http://localhost:8080
in your web browser.
Troubleshooting
Having problems? Check out our Troubleshooting guide.
MobilityData Release Process
Snapshots
We've set up a Maven repository on GitHub Packages to hold the snapshot artifacts from this project - GTFS Realtime Validator Packages. The GitHub Action test_package.yml
publishes to this repository.
NOTE: You need to authenticate with GitHub to download the below artifacts
If you want to include snapshot releases in your project, you'll need to add the following to the pom.xml
of the project you want to use it in:
<!-- MobilityData SNAPSHOTs/RELEASES -->
<repositories>
<repository>
<id>github</id>
<name>GitHub gtfs-realtime-validator</name>
<url>https://maven.pkg.github.com/MobilityData/gtfs-realtime-validator</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
...
<dependency>
<groupId>org.mobilitydata</groupId>
<artifactId>gtfs-realtime-validator</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
Projects based on this validator
- transport.data.gouv.fr - Online GTFS Realtime validation - A website by the French national access point to transport data that allows users to enter GTFS and GTFS Realtime URLs for validation. The gtfs-realtime-validator batch processor is then run by transport.data.gouv.fr and the results displayed on the website. Their project is open-source on GitHub.
- CalTrans California Integrated Travel Project (Cal-ITP) GTFS Realtime validation - Cal-ITP is using the gtfs-realtime-validator batch processor, along with an open-source Python wrapper they developed, to validate GTFS Realtime data for transit agencies in the state of California.
- CUTR-at-USF's transit-feed-quality-calculator - An open-source command-line Java application that uses the gtfs-realtime-validator batch processor to assess the quality of a large number of transit feeds. It downloads a list of GTFS Realtime feed URLs from OpenMobilityData, fetches GTFS Realtime feeds from those agency URLs, runs the gtfs-realtime-validator batch processor on all of the downloaded feeds, and then outputs summary statistics and graphs on the results.
- Traffic Brain (Japan) - Runs a hosted website version of the gtfs-realtime-validator-webapp in this project.
Acknowledgements
This project was initially created by the Center for Urban Transportation Research (CUTR) at the University of South Florida.
CUTR's development of the GTFS Realtime Validator prototype in 2018 was funded by the National Institute for Transportation Communities (NITC) via the project "Overcoming Barriers for the Wide-scale Adoption of Standardized Real-time Transit Information". It also included work funded under the 2015 Google Summer of Code.
In April 2022, MobilityData and CUTR announced a partnership to maintain and further improve the GTFS Realtime Validator.