Skip to content

An application to calculate on-time performance using archived GTFS-realtime data

License

Notifications You must be signed in to change notification settings

CUTR-at-USF/ontime-performance-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ontime-performance-calculator Build Status

An application to calculate on-time performance using GTFS-realtime data that has been archived using the gtfsrdb tool.

For more about what this tool does, please see the chapter "Producing On-time Performance from GTFS-realtime Data" in this final report.

Prerequisites

The On-time Performance Calculator is written in Java. Maven is the build management tool for this project.

Following are the requirements to get the project up and running:

Note that you can also use an integrated development environment (IDE) such as Netbeans or IntelliJ to build the project, which usually includes integrated support for Maven and Git.

You'll also need data:

  • GTFS data - A zip file containing GTFS data from the same time period as the archived GTFS-realtime data. Check out Transitland (and in particular the feed_versions API), TransitFeeds.com or GTFS Data Exchange (Deprecated) to find archived GTFS data.
  • Archived GTFS-realtime data - Data in a relational database (e.g., MS SQL Server) that has been archived using the gtfsrdb tool (or another tool that uses the same database schema). See TransitFeeds.com for a list of publicly-available GTFS-realtime feeds.

The following instructions are for building the project from the command line using Maven.

1. Download the code

The source files are needed in order to build the jar file. You can obtain them by downloading the files directly or by cloning the Git repository (recommended).

  • Clone this repository to your local machine.

    With git installed on the system clone the repository to your local machine.

    git clone https://github.com/CUTR-at-USF/ontime-performance-calculator.git

2. Build the project

From the command-line:

mvn install

3. Run the application

The above step will generate an executable file in the target/ directory with all the dependencies needed to run the application.

Before running the application, create an info.txt file in project's src/main/resources folder. This file should contain information needed to connect to Microsoft SQL Server database:

  • info.txt file should have the following information. Each line contains a tag and it's value separated by :
    • server : name of the server to connect to
    • username : name of the user
    • password : user password
    • database : name of the database to connect to

Finally, to run the application execute a command in the format:

java -jar target/ontime-performance-calculator.jar <path/to/GTFS_file.zip> <arrival_time OR departure_time> [number of records to fetch]

  • The application takes three arguments
    1. Path to static GTFS zip file
    2. arrival_time or departure_time - This argument tells the application whether to calculate schedule_deviation using arrival_time or departure_time at each stop
    3. Specify number of records to fetch from database table - This argument is optional. If it’s not provided, we retrieve all records from the table

Example command:

java -jar target/ontime-performance-calculator.jar gtfs.zip arrival_time

The above command assumes that the gtfs.zip file is in the same directory you're executing the java command from.

Note that this project is currently configured to connect to a SQL Server database, but other relational databases are also supported.

Releases

No releases published

Packages

No packages published

Languages