tool to convert transxchange data into a GTFS feed
Clone or download
Latest commit 1957dbf Jan 21, 2019


Travis npm David

transxchange2gtfs converts TransXChange timetable data into a GTFS zip.


There are other similar projects, each with their own merits. This tool has some features not found in the others:

  • Smaller output - identical calendars are reused
  • Better handling of bank holidays
  • Built in NaPTAN data (stop names, longitude, latitude)
  • Ability to process multiple files, including zips
  • Low memory usage - most large files use less than 1GB, processing the entire UK data set requires 2GB
  • Generates interchange time and transfers to nearby stops


Please note that zip/unzip and node 10.x or above are required. As zip/unzip are required this program will not currently run on Windows.

transxchange2gtfs is a CLI tool that can be installed via NPM:

sudo apt-get install nodejs zip
npm install -g transxchange2gtfs


It can be run by specifying the input and output files as CLI arguments:

transxchange2gtfs transxchange1.xml transxchange2.xml

Or using zip files:

transxchange2gtfs /path/*.zip single-transxchange.xml


  • All stop times are left in the original timezones (assumed to be local time).
  • It is assumed that any stops in different TransXChange documents with the same ATCO are the same stop.
  • Stop data is derived from NaPTAN.
  • TransXChange is a bizarre and over-engineered standard, there are probably edge cases that have not been covered.
  • A MySQL for the GTFS files is provided in the resource folder, along with an import script.


Issues and PRs are very welcome. To get the project set up run

git clone
npm install --dev
npm test

If you would like to send a pull request please write your contribution in TypeScript and if possible, add a test.


This software is licensed under GNU GPLv3.