Open a route in a trip planner that has never had GTFS shapes.txt built for it. The line on the map cuts straight through a building, across a river, or through a park with no road in it. The bus never went there. GTFS just had no better information to draw with, so it connected the dots the only way it knew how: the shortest path between two points, regardless of what actually sits between them.

That single missing file is easy to overlook, since GTFS validates and publishes without it. It is also one of the fastest ways for a small agency’s first feed to look unfinished the moment a rider zooms in.

What Is GTFS shapes.txt For?

shapes.txt is the optional General Transit Feed Specification (GTFS) file that records the actual street path a vehicle follows on a trip. It stores that path as a sequence of GPS points, per the gtfs.org shapes.txt reference. Without it, a consumer connects each pair of stops with a straight line instead of the real road geometry. With it, the route on a rider’s map matches the road the bus actually drives.

GTFS shapes.txt is not something a rider ever opens directly. It is the file that determines whether the map behind an app looks like the agency’s actual streets.

Each point in a shape carries a latitude, a longitude, and a sequence number marking its order along the path. trips.txt links a trip to a shape_id. Every trip sharing that same physical path reuses the same shape rather than each one needing its own copy. One clean shape per route pattern, built once, generally covers every trip that runs it.

What Riders See Without It

A straight-line route looks obviously wrong the moment a road curves. It looks just as wrong when a route loops back on itself, or when two stops sit on opposite sides of a river with no bridge between them on the drawn line. Riders notice a route line running through a lake even when they cannot articulate why the map feels untrustworthy. That first impression carries weight. A rider who sees an obviously wrong line has less reason to trust the arrival time sitting right next to it, even when that time is accurate.

A loop route suffers the most. Without a shape, a trip planner has no way to know a route goes out one way and comes back a different way. It draws one straight segment covering both directions, collapsing an entire loop into a single line that matches neither direction of actual travel. A rider trying to visually confirm which side of the street to wait on gets no help from a map like that.

Without shapes.txt With shapes.txt River River 0.5 mi drawn 2.0 mi actual

Distance Calculation

The problem runs deeper than appearance. Straight-line distance between stops is almost always shorter than the road distance a vehicle actually covers. On a route with turns, a loop, or a river crossing, the gap can be dramatic. Any calculation built on that shortened distance inherits the error. That includes the passenger mile figure a system derives for reporting. Passenger miles traveled depends on knowing how far a vehicle actually traveled between two points, not the distance a ruler would measure on a flat map.

A route with a genuine detour around a body of water is the clearest case. Two stops might sit a straight-line half mile apart while the road route between them runs closer to two miles once the shoreline is accounted for. A distance figure built without shapes.txt, or from a shape drawn straight across the water, understates that trip by a wide margin. Every downstream calculation built on it, running time estimates, distance-based reporting, fuel and mileage planning, inherits the same understatement.

Producing Shapes

Three ways to build a shape, in order of how most small agencies actually get there. A single GPS-tracked run of the route, recorded once and cleaned up afterward, is the most common starting point. It works well for a route that runs the same path every time. Drawing the geometry by hand along a road network works too, using a mapping tool that snaps a line to actual streets. It is the fallback when a GPS trace is not available, or turns out messy.

Deriving a shape from accumulated vehicle location data is the third path. It is built from many real trips’ worth of Computer-Aided Dispatch / Automatic Vehicle Location (CAD/AVL) positions, rather than one deliberate recording run. Once enough trips have been logged, it produces the most accurate result. It reflects the path vehicles actually drive, not one sampled pass.

Raw AVL points Many trips shapes.txt One clean line Stray point

Accuracy expectations for any of the three methods are modest, not exacting. A shape that follows the correct streets and turns in the correct order serves a rider well, even if it is off by a few meters from the exact lane a vehicle drives. What actually breaks a shape is different. It might be a wrong turn recorded in the trace, a road that has since been closed or rerouted, or a stop assigned to the wrong shape entirely. Sub-meter precision was never the bar.

A raw GPS trace also needs a light cleanup pass before it becomes a usable shape. For a small system that pass is usually short, not weeks of work. A phone or onboard unit occasionally logs a stray point, a brief signal bounce off a building that puts one recorded point somewhere the vehicle never was. Left in, that single bad point can put a visible spike or loop in an otherwise clean shape. Most mapping tools used to build shapes flag an obvious outlier automatically, but a quick visual check of the finished line against the known route catches whatever the tool misses.

Maintaining Shapes Through Detours

A shape built once and never revisited goes stale the first time a road closes for long. When a planned detour runs long enough to go into the schedule, its trips should carry a detour shape for exactly the days it is in effect, then revert once the closure ends. Leaving the original path in place while the actual route diverges from it on the map is the more common mistake. Detour and dispatch management covers how a detour gets communicated operationally, which is the same event that should trigger a shape update.

A permanent route change is simpler to manage than a temporary one, since the shape just gets rebuilt once and stays that way. A temporary detour is the case agencies most often skip. Reverting a shape back afterward is easy to forget once the road reopens and nobody is looking at the map anymore.

The safest habit is treating a shape update as part of the same checklist as a scheduled detour, not a separate task remembered later. Whoever already has to reroute the trips, notify riders, and log the change has one more line to add. Update the shape for the days the detour runs, and confirm it reverts on schedule once the road reopens. Skipping that line does not break anything today. It just leaves a wrong line on the map the next time someone happens to look.

Is shapes.txt Required?

Not strictly. GTFS validates and publishes without it. Effectively, yes, since every consumer-facing problem covered above, straight lines through buildings, inflated or understated distance, rider distrust, only exists because shapes.txt is missing. A feed that publishes without shapes is not broken. It is just visibly worse than one that has them, and riders can tell the difference even when they cannot name the missing file.

Talk to Us About Your GTFS

TransitFare is a transit technology company founded in 2012 that builds GTFS publishing tools for small and mid-sized transit agencies, from fleets of 10 vehicles to fleets of 50 vehicles. TransitFare Cloud publishes shapes.txt from each route’s trip shapes. Many agencies that skip it come back to add it later anyway, once riders start asking why the map looks wrong. Talk to us about your GTFS, or start with the GTFS guide for the full standard this file fits into.