Transform GTFS feed into an unordered JSON-LD stream of connections.
This project is written in PHP and uses doctrine to load the GTFS files into a MySQL database.
Note: only feeds with pure calendar_dates.txt are supported for now
A connection tells when a vehicle starts and ends with respectively a different stop.
Example:
{
"@type":"Connection",
"@id":"connection:130660",
"arrivalTime":"2015-10-02T12:12:00.000Z",
"arrivalStop":"34604",
"departureTime":"2015-10-02T12:09:00.000Z",
"departureStop":"88863",
"trip":"14865676",
"route":"24332",
"headsign":"Tongeren - Vroenhoven"
}
* Composer
* MySQL
* PHP 5.4+
We use the PHP package manager Composer. Make sure it's installed and then run from this directory:
composer install
Fill in your MySQL credentials inside db-config.php
.
scripts/init.sh path-to-gtfs.zip
To enable interoperability between different operators, generate a CSV-file that maps neighbour stops to one "connection stop": connection stops
php scripts/load_connection_stops.php connection-stops.txt
php scripts/create_connections.php [startDate] [endDate]
The format of date parameters must be 'YYYY-MM-DD'.
Note: optional parameters startDate
and endDate
only work when there are no calendars.
You can find connections-[agency_id].jsonldstream in dist
folder.