NO 'Trip_id' information for BUS of 'Stop_time' file


#1

I would like to match both ‘Stop_time’ file and ‘Trip’ file together with same information called ’ Trip_id ',
but as for the ‘trip id’ information, there is NO bus information for ’ trip_id 'in ‘Stop_time’ file which is the data I need.
May I please also inquire that what does those parts of trip id mean, is it just a automatic name base on the dataset and veh. journey id?
Thank you soo much


#2

Hi @Dong, I encourage you to read all our documentation and the GTFS spec, have a look at these links:

Hopefully these answer most of your questions, if you still have doubts please post back and let us know what you’re still unsure about.

Thanks,
Alex


#3

Hi Alex,
Thanks for the replying
I have read all those doc for several times.
it is like that from the ‘Route’ file that I can select for bus services for CBD only (according to ’ route shor name’ and ‘route type’), so that I can get the ‘route id’ for my demand; then connect the ‘Route’ file and ‘Trip’ file with ‘route_id’ so that I can get the required ‘trip_id’, which can also be matched with ‘Stop-times’ file for the time information I need. But after the selection, I cannot find the required ‘trip_id’ from ‘Stop-times’ file because there is no such data that can be matched. I have also read all the doc as your suggestion, but there is no even bus information in ‘Stop-times’ file (the trip id for bus should be like 130.TA.25-423-sj2-1.1.R, the middle three value represent short route name means the route name of the bus , as introduced from doc.)
Please hint me that how can I get the trip id for bus only in ‘Stop-times’ file.
Thanks a lot.
Dong


#4

Hi Alex,
Instead, could you please help explain what does ’ BMT, HUN, CCN, SCO, T1-A’ mean? as far as I know,’ BMT’ refers to train services, but I have no idea about the others.
Thank you very much.
Dong


#5

Hi @Dong,

BMT = Blue Mountains Train
HUN = Hunter Line
CCN = Central Coast
SCO = South Coast
T1-A I’m guessing is related to the T1 city line

Thanks,
Alex


#6

Hi Alex,
Thanks for the replying.
According to those abbreviation, the ‘trip id’ which including those information means that they should be a train data.
Thank you very much!
Dong


#7

Hi Alex,
I have briefly analysed one of the Timetables Complete GTFS files named ‘stop-time’, and I am afraid that there are no information about city bus as the file ‘trip id’. the bus routes in ‘stop-time’ are around 661 to 876 instead of the route number 169-520 referring to the CBD services.
Additionally, could you please help figure what does the trip id mean? take an example like this ‘1301.TA.2-BMT-sj2-1.80.H’, what does ‘1301’, ‘TA.2’ and ‘1.80.H’ mean?
Thank you very much
Dong


#8

Hi @Dong, the 1301 is the number of trips in the day overall, TA.2 just means it’s one of the train services and H means it’s an outbound service. Most of this information you shouldn’t have to worry about.

For the first part of you question about the city buses, can you please clarify what you’re trying to do? We haven’t had any errors or issues with the feeds or bundles so the files should be correct.

Thanks,
Alex


#9

Hi Alex,
Thanks for your patiently reply.
As far as I learned from the instruction file, the trip id like ‘797.TA.2-BMT-sj2-1.19.R’ should be referred as a bus route data, but it also including the part ‘TA.2’ though with different digit value (such as TA.2, TA.20, TA.21, TA.22), may I please inquire that what does this digit number mean?

As for the query of the required data, my apology that I have not figure out how to get realtime data. So far I am using the complete GIFS of timetable, so I am wondering that if there no data for bus serving CBD area, I should probably focus on the realtime data, but as the instruction doc, there should be the information about bus service(700, as for the realtime data, should be called /buses/SMBSC006,007,008,009).

Regarding to the research I am doing, I am try to find out the trajectories of bus which services for CBD, and now, I have already get the bus route short name for the bus serving CBD, it is a need for arrival and departure time in ‘stop time’ file for those select bus route.
Thank you so much
Dong


#10

Make sure you’re using the correct GTFS timetable data.

GTFS for realtime - This is the GTFS timetable that matches the realtime timetable
https://opendata.transport.nsw.gov.au/dataset/public-transport-timetables-realtime

“Static timetables, stop locations, and route shape information in GTFS format for operators that support realtime”

GTFS Timetables complete - this is a ‘different’ version of the GTFS timetable that doesn’t match the realtime
https://opendata.transport.nsw.gov.au/dataset/timetables-complete-gtfs

“Static timetables, stop locations, and route shape information in General Transit Feed Specification (GTFS) format for all operators, including regional, trackwork and transport routes not available in realtime feeds.”


#11

Hi dcooley,
Thank you for your replying.
I understand that there are two kinds of file. And I am using the complete one (second attachment you send), but there is no information for bus with the route number from 169 to 520, which are the data I need. Besides, there are information in files like ‘route’ and ‘trip’, but what I need is the time of arrival and departure.
Could you find the arrival time as well as the departure time for bus route 169 in ‘stop_time’ file of ‘TimeTable complete GTFS’ as an example?
Thank you so much
Dong


#12

Hi Dong,

If you’re after all the stop times that for a particular bus route number (e.g. 169), you need to find the route_ids with route_short_name = 169 in routes.txt.

Then, match those route_ids, in the trips.txt file. Then match the trip_ids to the stop_times.txt file.

Basically:

| routes.txt             | trips.txt | stop_times.txt |
-------------------------------------------------------
| route_short_name = 169 |
| route_id ------------> | route_id  |
|                        | trip_id ->| trip_id        |
|                        |           | arrival_time   |

#13

Hi jxeeno,
Thank you very much. But this is what I did for the data analysis, but there is no data for bus servicing CBD area in file ‘stop-time’, means that the problem is not the following of the steps, but there is no information that I can select…
I am wondering that maybe I did not notice how to find it out or maybe I looked the wrong place, so, may I please ask that could you get the information about the arrival and departure time(e.g 169) from file’stop_time’?
Thanks a lot
Dong


#14

Hi Dong,

Let’s step through it:

  • routes.txt: route_short_name = 169 has a route_id = 28-169-sj2-1
  • trips.txt: Look for trips with route_id = 28-169-sj2-1. (e.g. trip_id = 158.TA.28-169-sj2-1.16.H)
  • stop_times.txt: Look for the stop time for the desired stop (e.g. stop_id = 2000295 - i.e. Wynyard Station) and the trip_id in question (e.g. trip_id = 158.TA.28-169-sj2-1.16.H).

You might also want to have a play around and explore the GTFS files on TransitFeeds.com so you have a better understanding of how it all links together.


#15

Hi jxeeno,
Thank you very much! Transitfeed is a great resource for me,thanks.
However, when I search in the Timetable complete file, there is no data for bus like route 169. As shown in the following pics.

May I inquire that is your stop_time data for 169 get from complete file or realtime file?
I am try to get the data from realtime file, but currently, I am learning python …

Thank you so much
Dong


#16

Dear jxeeno,
I have found that I made a stupid mistake…it may because of the file is not loaded completely…shame, I will fix this and see.
Thank you soooo much!
Dong


#17

Great to hear you worked it out :slight_smile:


#18

Hi jxeeno,
I have made it! I got every routes’ information I need~

However, the arrival time and the departure time are same for those bus lines, otherwise, the shape_dist_traveled is odd if the arrival time and the departure time are different and the gap between arrival time and departure time is 1 or 2 mins, which seems not correct, as well. I will keep working on the ‘troublesome’ data anyway!

Thank you for the previous help!
Have a great Easter holiday.