GTFS Best Practices

Adding Route Shapes

Optional Data (Shapes, Fares, and Rules):

  • Goal: Enhance your feed with optional information that simplifies and enriches navigation of your transit system.
  • Required information: Latitude and longitude information associated with the shapes of your routes.
  • Optional information: Fare information and rules.
  • Estimated completion time: Up to 3 days.

Generate Shapes File (shapes.txt):

shapes.txt, as defined in Google Transit Feed Specification, contains information about the shape of a particular route, that is, the actual distance and trajectory between stops in a route and not the straight-line distance between two points.

  • shape_id: This required field contains an ID that uniquely identifies a shape.
  • shape_pt_lat: This required field associates a shape point's latitude with a shape ID in a valid WGS 84 format.
  • shape_pt_lon: This required field associates a shape point's longitude with a shape ID in a valid WGS 84 format.
  • shape_pt_sequence: This required field associates the latitude and longitude of a shape point with its sequence order along the shape.
  • shape_dist_traveled: This optional field positions a shape point as a distance traveled along a shape from the first shape point.

Expected time to complete: Up to 3 days.

Test Shapes in Google Maps

  • Goal: Verify that shapes appear correctly in Google Maps.
  • Required information: A validated feed and URL.
  • Estimated completion time: 1 week

Shapes, as defined by your feed, should accurately reflect a given route.