Search
Clear search
Close search
Google apps
Main menu

Create your data feed

Trips

A trip is a sequence of two or more stops that occurs at specific time. You define trips in the trips.txt file, which has the following structure:

trips.txt file structure

The following example shows a simple trips.txt file:

route_id,service_id,trip_id,trip_headsign,block_id

A,WE,AWE1,Downtown,1

A,WE,AWE2,Uptown,2

Headsign information

The trip_headsign field should contain the text that appears on the vehicle or on signage that identifies a specific line variant to riders. It shouldn’t duplicate the values in the route_short_name or route_long_name.

In most cases a headsign contains information about a trip destination. However, you can also use a direction like inbound/outbound if that matches the signage your passengers see. 

Although it’s not mandatory, we recommend that you provide a trip_headsign. Otherwise, we'll use the name of the last stop of the corresponding trip as the trip_headsign in routing results. However, this may change and you shouldn't rely on it as a long-term solution. 

Circular trips

A circular trip, also known as a loop trip, is a trip that follows a circular path. The above guidelines for headsigns also apply for circular trips. For example, provide headsign information that shows riders the direction in which the vehicle is going.

To indicate the changing direction of travel, provide stop_headsigns in the stop_times.txt file. The stop_headsign describes the direction for trips departing from the stop for which it's defined. Adding stop_headsigns to each stop of a trip allows you to change the headsign information along a trip.

Don’t define one single circular trip in the stop_times.txt file for a route that operates between two endpoints (such as when the same bus goes back and forth). Instead, split the trip into two separate trip directions.

Examples of circular trip modeling

1. Circular trip with changing headsign for each stop

Trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign

trip_1,06:10:00,06:10:00,stop_A,1,”B”

trip_1,06:15:00,06:15:00,stop_B,2,”C”

trip_1,06:20:00,06:20:00,stop_C,3,”D”

trip_1,06:25:00,06:25:00,stop_D,4,”E”

trip_1,06:30:00,06:30:00,stop_E,5,”A”

trip_1,06:35:00,06:35:00,stop_A,6,””

2. Circular trip with two headsigns

Trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign

trip_1,06:10:00,06:10:00,stop_A,1,”outbound”

trip_1,06:15:00,06:15:00,stop_B,2,”outbound”

trip_1,06:20:00,06:20:00,stop_C,3,”outbound”

trip_1,06:25:00,06:25:00,stop_D,4,”inbound”

trip_1,06:30:00,06:30:00,stop_E,5,”inbound”

trip_1,06:35:00,06:35:00,stop_F,6,”inbound”

trip_1,06:40:00,06:40:00,stop_A,7,””

Was this article helpful?