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

KyleGancarz/gtfs-realtime-validator

 
 

Repository files navigation

GTFS-realtime Validator Build Status 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 GTFS 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) 1.8 or higher

Run the webapp

  1. Download the latest webapp alpha build:
  2. From the command line run java -Djsse.enableSNIExtension=false -jar gtfs-realtime-validator-webapp-1.0.0-SNAPSHOT.jar
    • Note that if you're running on Java 9, you'll need to instead run java -Djsee.enableSNIExtension=false --add-modules java.xml.bind -jar gtfs-realtime-validator-webapp/target/gtfs-realtime-validator-webapp-1.0.0-SNAPSHOT.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:

Please note that if you're using https URLS, you'll need to use the -Djsse.enableSNIExtension=false command-line parameter or install the Java Cryptography Extension (JCE) - see the Prerequisites section for details.

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:

If you're using https URLs for GTFS or GTFS-rt feeds, either:

  • Use the -Djsse.enableSNIExtension=false parameter when running the tool
  • Install the Java Cryptography Extension (JCE) - You will need to replace the US_export_policy.jar and local_policy.jar files in your JVM /security directory, such as C:\Program Files\Java\jdk1.8.0_73\jre\lib\security, with the JAR files in the JCE Extension download.

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 8 and lower: java -Djsse.enableSNIExtension=false -jar gtfs-realtime-validator-webapp/target/gtfs-realtime-validator-webapp-1.0.0-SNAPSHOT.jar

  • Java 9 and above: java -Djsee.enableSNIExtension=false --add-modules java.xml.bind -jar gtfs-realtime-validator-webapp/target/gtfs-realtime-validator-webapp-1.0.0-SNAPSHOT.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

Want to run this in Docker? Check out gtfs-realtime-validator-docker.

Troubleshooting

Having problems? Check out our Troubleshooting guide.

CUTR Release Process

Snapshots

We've set up a Maven repository to hold the snapshot artifacts from this project in a Github project - cutr-mvn-repo.

At CUTR, we should run the following at the command-line to create a new artifact:

mvn -Dgpg.skip -DaltDeploymentRepository=cutr-snapshots::default::file:"/Git Projects/cutr-mvn-repo/snapshots" clean deploy

Then commit using Git and push new artifacts to Github.

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:

<!-- CUTR SNAPSHOTs/RELEASES -->
<repositories>
    <repository>
        <id>cutr-snapshots</id>
        <url>https://raw.githubusercontent.com/CUTR-at-USF/cutr-mvn-repo/master/snapshots</url>
    </repository>        
</repositories>

Acknowledgements

This project 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 includes work funded under the 2015 Google Summer of Code.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 69.0%
  • JavaScript 27.0%
  • HTML 3.4%
  • Other 0.6%