There are other similar projects, each with their own merits. This tool has some features not found in the others:
Please note that zip/unzip and node 14.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:
npm install -g transxchange2gtfs
or used directly with npx:
npx transxchange2gtfs ...
It can be run by specifying the input and output files as CLI arguments:
transxchange2gtfs transxchange1.xml transxchange2.xml gtfs-output.zip
Or using zip files:
transxchange2gtfs multiple-transxchange-files.zip /path/*.zip single-transxchange.xml gtfs-output.zip
Prior to version 1.9.0 nested zip files we're ignored. They are now processed recursively.
On occasion, a large dataset will cause a
heap out of memory issue. In this case, set the
NODE_OPTIONS environment variable to increase the heap size.
For example to set to 8GiB, in a linux shell:
NODE_OPTIONS=--max-old-space-size=8192 transxchange2gtfs transxchange.zip gtfs-output.zip
It's possible to set the default agency URL, language and timezone:
AGENCY_URL=http://agency.com AGENCY_TIMEZONE=Europe/London AGENCY_LANG=en transxchange2gtfs transxchange.zip gtfs-output.zip
On first run transxchange2gtfs will download the latest Stop data from NaPTAN. If you would like to force a refresh of the data add
transxchange2gtfs --update-stops transxchange.zip gtfs-output.zip
Node.js version >= 12 is required.
Issues and PRs are very welcome. To get the project set up run
git clone [email protected]:planarnetwork/transxchange2gtfs 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.