A common question we get from our clients is whether their GTFS data can help them streamline processes around NTD reporting.
There are many ways GTFS can help you in the NTD reporting process, but one quick and simple way is by helping you find the distance between your bus stops.
The NTD requires you to measure the number of miles your buses move between stops. Luckily, a field that describes just that is in your GTFS.
Calculate Distance Between Stops
- Download a copy of your GTFS.
- Unzip the file and open the generated folder.
- Rename the files stop_times.txt to stop_times.csv and stops.txt to stops.csv.
- Open the files in a spreadsheet software, like Excel, and make both available in the same spreadsheet (ie, open one file in Excel, add another tab, and copy/paste the other file into the new tab.)
- In stop_times.csv, identify a Trip that you wish to find the distance between Stops for.
- The final column, shape_distance_traveled, is the key information we're looking for. If your GTFS has shapes properly identified, then this field exists in your GTFS data.
- Using vlookup attach a stop name from stops.csv to the stop_id in stop_times.csv.
- A single Trip may have a few, or many, stop_ids associated with it. The stop_sequence column tells you the order the Stops occur in.
- Voila! You now have a list of stop names (and any other fields you wish to vlookup) and the distance travelled between them. The measurement matches whatever unit (such as kilometers or miles) used in shapes.txt. For files generated by GTFS Manager, these values are in meters.
Looking for other ways to streamline your reporting and organize your data across platforms? Email email@example.com and find out how we can help.
Please sign in to leave a comment.