GTFS Best Practices

Entering Trips

trips.txt, as defined in General Transit Feed Specification, contains information about one or more trips in a given feed. A trip represents a single vehicle journey.

  • route_id: This required value is referenced from routes.txt and identifies the route that this trip belongs to.
  • service_id: This required value is referenced from the calendar.txt or calendar_dates.txt file and will define the days this trip is available.
  • trip_id: Each different trip must have a unique ID.
  • trip_headsign: This optional field contains the text that appears on a sign that identifies the trip's destination to passengers. Use this field to distinguish between different patterns of service in the same route. If the headsign changes during a trip, you can override the trip_headsign by specifying values for the the stop_headsign field in stop_times.txt.
  • trip_short_name: This optional field contains the text that appears in schedules and sign boards to identify the trip to passengers, for example, to identify train numbers for commuter rail trips. If riders do not commonly rely on trip names, please leave this field blank.
  • direction_id: This optional field contains a binary value that indicates the direction of travel for a trip. Use this field to distinguish between bi-directional trips with the same route_id.
  • block_id: This optional field identifies the block to which the trip belongs. A block consists of two or more sequential trips made using the same vehicle, where a passenger can transfer from one trip to the next just by staying in the vehicle. The block_id must be referenced by two or more trips intrips.txt.
  • shape_id: This optional field contains an ID that defines a shape for the trip. This value is referenced from the shapes.txt file.