Skip to content

Java-based tool that validates General Transit Feed Specification (GTFS)-realtime feeds

License

Notifications You must be signed in to change notification settings

MobilityData/gtfs-realtime-validator

 
 

Repository files navigation

GTFS Realtime Validator Test and Package Docker image Join the GTFS Realtime chat

A tool that validates General Transit Feed Specification (GTFS)-realtime feeds

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

  1. Install Java Development Kit (JDK) 11 or higher

Run the webapp

  1. Download the latest webapp snapshot jar of the validator from the webapp package.
  2. 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 is gtfs-realtime-validator-webapp-1.0.0-20220223.003109-1.jar, you would run java -jar gtfs-realtime-validator-webapp-1.0.0-20220223.003109-1.jar.
  3. When prompted, in your browser go to http://localhost:8080
  4. Enter your General Transit Feed Specification (GTFS)-realtime and GTFS feed URLs and click "Start". Example feeds:

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 is gtfs-realtime-validator-webapp-1.0.0-20220223.003109-1.jar, you would run java -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:

http://localhost:8080

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

  1. Download and install Docker
  2. 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

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.

About

Java-based tool that validates General Transit Feed Specification (GTFS)-realtime feeds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Java 69.3%
  • JavaScript 27.1%
  • HTML 3.4%
  • Other 0.2%