What Is the Purpose of GTFS shapes.txt?
From the earlier reference collection. Read the current software blog.
Route shapes provide geometry that can help map a transit service, while stop times remain the source for the trip’s ordered scheduled stops.
Geometry gives a map a path to draw
A list of stops tells a consumer where a trip calls, but it does not necessarily describe the road or rail path between them. GTFS shapes.txt can provide ordered geographic points representing a route or trip shape. A mapping application can use those points to draw a line that better follows the represented service path than a straight segment between every pair of stops.
The shape is a geometric aid. It should be associated with the trips that use it through the dataset’s references, then interpreted in its point order. A consumer should check the feed’s field definitions and valid references rather than assuming every trip has a shape.
Keep stops and schedules authoritative for passage
A route line on a map is not a timetable. stop_times.txt associates a trip with ordered stops and scheduled times, while shapes describe geometry. If a shape passes near a location, that alone does not establish that the vehicle stops there. Likewise, a stop-time sequence does not specify the exact curve the map should draw between stops.
Consider a bus trip with stops at a library and a hospital. A shape may show the street path that connects them, including bends that make the map legible. The stop-time records still determine that the trip serves those two locations and its scheduled passage. A nearby point on the drawn path is not an additional boarding stop unless the schedule data says so.
Use shapes with sensible fallbacks
A map consumer can display a shape when the feed provides a usable one and fall back to a simpler connection between stops when it does not. That fallback should remain visually understandable and should not be presented as precise road geometry. For quality checks, compare the shape’s order and location with the trip’s stop sequence, looking for unexpected reversals or paths far from the stops. The shape can improve presentation, but validating the underlying schedule remains a separate task.
Explain what the line represents
A clear map legend or help text can tell users that a drawn line represents route geometry supplied by the schedule feed and that listed stops indicate scheduled boarding locations. This avoids asking the geometry to answer operational questions it was not designed to answer. The GTFS reference lists shapes.txt as a dataset file alongside stops and stop_times. Reading those files as complementary parts of the model gives a map useful context while preserving the distinction between a path and a schedule.