bdferris edited this page Sep 19, 2014 · 1 revision

In many cases GTFS users have a need to combine two feeds that represent different service periods for their service. For example, an agency that changes their schedule quarterly might have one GTFS file for the January-March period and another for the April-June period. The merge tool helps users combine these two files so they can publish a GTFS file without any gaps in service.

Using Merge

The merge tool is intended to merges schedules. New stops will be handled but some changes like moving stops may cause problems.

Installing and running the Windows binary

First download the compiled version of the TransitFeedDistribution for Windows from downloads. Unpack the zip file to some location - for the purposes of this document let's assume the zip file is unpacked to C:\ so all the files are in C:\transitfeed-windows-binary-1.2.0. The merge tool is merge.exe.

Open a command line window by going to the Start menu, selecting "Run...", typing cmd and press enter. Go to the directory where you have the GTFS files you want to merge using the cd command. If the files are in c:\gtfs_files type `cd \gtfs_files'.

To merge two feed files, you pass the name of the two files on the command line along with the name of the new merged GTFS file.

For example, if the two feed files are and then you use the following command line:


If there are no errors you will have a new file, which will contain the schedule for both January and February.

If you have small files or lots of RAM you can try the option --memory_db which runs much faster.

Running from Python source

After you have installed the TransitFeedDistribution source simply run python For additional options try python --help.

If you have small files or lots of RAM you can try the option --memory_db which runs much faster.

Command line usage

Usage: [options] <input GTFS> <input GTFS> <output>

Merges <input GTFS> and <input GTFS> into a new GTFS file

  --version             show program's version number and exit
  -h, --help            show this help message and exit
                        a transition date from the old feed to the new feed in
                        the format YYYYMMDD
                        the furthest distance two stops can be apart and still
                        be merged, in metres
                        the furthest distance the endpoints of two shapes can
                        be apart and the shape still be merged, in metres
                        write the html output to this file
  --no_browser          prevents the merge results from being opened in a
  -m, --memory_db       Use in-memory sqlite db instead of a temporary file.
                        It is faster but uses more RAM.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.