MKuranowski / WarsawGTFS

Creates GTFS feed from ZTM Warsaw data
https://mkuran.pl/gtfs/
MIT License
34 stars 9 forks source link
gtfs open-data public-transportation warsaw

WarsawGTFS

Description

Creates GTFS data feed for Warsaw. Static data comes from ZTM Warszawa FTP server and optionally mkuran.pl website. Realtime feeds incorporate data from https://api.um.warszawa.pl.

Features

  1. Line colors
  2. Calendar exceptions
  3. Trip headsigns and On-Request stops
  4. Fares
  5. Adding town names to stop_name
  6. Proper handling of virtual stakes
  7. Getting railway platforms from manually curated data
  8. Getting missing stop positions from manually curated data
  9. Inserting metro schedules from mkuran.pl
  10. Realtime data
  11. Shapes generator: Buses based on OSM Data, Rail/Tram based on my own graph.

Static GTFS script

Requirements

First of all you need Python3 and several modules, included in requirements.txt, so run pip3 install -r requirements.txt.

Then start the script with python3 warsawgtfs.py

Configuration

Run python3 warsawgtfs.py -h to see all possible options with their descriptions. All of those are optional.

Creating GTFS

Run python3 warsawgtfs.py with desired command line options. After some time (up to 1 min, or 15 mins with the --shapes option turned on) the gtfs.zip file should be created.

Produced GTFS feed has additional columns not included in standard GTFS specification:

Realtime GTFS script

These scripts are written in go and as such require the go command to be available. You can run the main warsawgtfs_realtime.go script with go run warsawgtfs_realtime.go or by compiling it first with go build warsawgtfs_realtime.go.

There are several dependencies required by this project, all listed in the go.mod file. AFAIK they should be downloaded automatically when running/compiling the project. If they are not, go mod download explicitly downloads the dependencies.

Brigades and positions feeds are mostly based on data from https://api.um.warszawa.pl.

Alerts

Creates the GTFS-Realtime feed with a list of all known alerts.

This mode is enabled by the -a command line flag. Here are all available options:

Brigades

Creates a file joining a brigade number to a list of trips (for today only), required for positions.

This mode is enabled by the -b command line flag. Here are all available options:

Positions

Creates the GTFS-Realtime feed with a vehicle positions and their active trips.

This mode is enabled by the -p command line flag. Here are all available options:

License

WarsawGTFS is provided under the MIT license. Please take a look at the license.md file.