geography for route_pattern_id

36 views
Skip to first unread message

Kathryn Rodgers

unread,
Oct 26, 2021, 1:25:35 PM10/26/21
to MBTA Developers
Hello,

I would like to calculate the average train miles traveled on each commuter rail line. I have the data from MBTA GTFS, and I think the trips.txt file tells me number of unique trips (trip_id) for each trip type (schedule_id), and the length of the trip with in each route_id may vary based on route_pattern_id. Is my reading of the GFTS documentation correct? I have the commuter rail shape file from MA GIS - what is the best way for me to connect route_pattern_id with start and stop information, so I can see what part of the track is covered?

Thank you,
Kathryn

Developer at MBTA

unread,
Nov 8, 2021, 2:16:41 PM11/8/21
to MBTA Developers
Hi Kathryn,

Shape information is available in GTFS as well, which is likely more convenient than cross-referencing the data from GIS. You should see each trip has a `shape_id`, which corresponds to entries in shapes.txt (see also our docs). The `shape_dist_traveled` column indicates how many meters are traveled up to that point on the shape, starting from the first point. If you are only looking for the complete length of each trip, you can look at the value of `shape_dist_traveled` for the last point, i.e. the one with the highest `shape_pt_sequence`.

> I think the trips.txt file tells me number of unique trips (trip_id) for each trip type (schedule_id)

Could you clarify what you mean by "trip type" here? There is no column named `schedule_id` in the GTFS spec.

—Developer@MBTA
Reply all
Reply to author
Forward
0 new messages