How Middletown and Other Small Transit Agencies Can Appear on Google Maps
This piece will go into how to easily create and maintain a General Transit Feed Specification Feed (GTFS) necessary for online trip planners to utilize a transit service’s information. I have published all of the files needed for Middletown Area Transit here. Below are short next steps Middletown Area Transit can do to check and upload the information so it can be used by Google maps:
- Double Check the Excel Sheets for any time errors or stop location mistakes. Contact me with the issues, or feel free to edit them on the Excel sheets as well.
- Register Middletown Area Transit as a Google Transit Partner here. It’s quick, easy, and free.
- Tell Middletown IT to upload the file MATCT_GTFS found in the shared Google drive according to the directions here.
- Within a few hours MAT Bus Routes will start show up on Google maps and thousands of Middletown residents will be exposed to MAT services when searching directions for local destinations.
Updating and Maintaining the Feed
GTFS is a standard format created for transit agencies to make their transportation service data accessible to online trip planners and application developers. To see transit feed examples already in Connecticut and around the world transitland’s website is a great place to explore, and was helpful for reference when completing this project. Another useful resource is Google’s GTFS developer site which provides all the descriptions of the formatting and code standards.
Maintaining and updating this feed is probably Middletown Area Transit’s (MAT) biggest concern because it’s hard to know if there will be another interested student or paid staffer to maintain this. Fortunately, all that is needed is some basic Excel skills to maintain GTFS, and there are even organizations such as the National Rural Transit Assistance Program (RTAP) that offers their own tool for converting Excel sheets into GTFS. So if the current customized Excel sheets provided don’t cut it for future schedule and route updates, MAT can move to this other tool by simply modifying the Excel sheets I’ve provided.
Below are screenshots of the files provided to MAT. These files are on a publicly accessible Google Drive Folder and include the Excel files and the GTFS files.
A GTFS feed requires the following text files to be put in one folder, in this case I named the folder MATCT_GTFS. To create these blank files with these names just go to Notepad on Windows or TextEdit on Mac to create them. However, since they’re already created you can just open them and make modifications when necessary. Afterwards remember to re-upload the modified files or the changes won’t show on Google maps.
Each file is just a simple text file with values separated by commas. You can use Excel to format the code for you, and the Excel files provided are already in the correct format. Once you have the Excel file all ready do the following:
- Save a copy of the Excel file as a .CSV file. Keep original file as well since that may have formulas that won’t carry over in .CSV format.
- Then right click the file and click “open with” Notepad (or TextEdit if on Mac). Do not use Excel to open the file.
- Copy and paste the file you just opened into the appropriate .txt files.
Since many of the routes are repetitive and run every 50 minutes or so much of the automation in creating the timetable can be a simple Excel formula. For example: =B2+TIME(0,50,0). However, there is a little bit of complexity with routes that skip stops at certain hours or run faster at certain times and those usually have to be manually typed in.
Another repetitive task might be creating the trip IDs. In this case the IDs are a combination of text and numbers so there is some special formatting involved. One solution to incrementing the IDs is the following: =CTRIP”&TEXT(RIGHT(A1,2)+1,”00"). So the text is put in quotation marks and the number is added from the previous cells.
Lastly, there are other .txt files that can be added to MAT’s GTFS feed such as shape files. The shape files show the route the bus will take. By default Google map just draws a route between the stop locations which little regard for the road taken. Many transit agencies do not put shape files in because it is time consuming and the stops are close together anyway, but it might be worth it for MAT since the buses stop at many places along the route not just the time points.
If there are any other questions feel free to comment below, I look forward to working with MAT or CTDOT to get this done.