Docs · Editor panels · Routes & shapes

Routes & shapes

Routes are defined before stops in GTFS·X. The alignment is the most consequential design choice in a transit service, so the editor's workflow locks in the path first, then places stops along it. Each route can have multiple shape variants — typically one per direction of travel.

GTFS·X editor with the Routes panel showing the demo feed's six routes overlaid on the map.
The Routes panel. Each route lists its mode, stop count, and trip count; selecting one opens the per-route detail panel with shape and timetable tabs.

Creating a route

Route detail panel for a newly-created Untitled Route, with form fields for short name, long name, description, URL, route type, color, and direction labels.
The new-route panel. Fill in the form on the Details tab, then move to the Stops and Trips tabs to wire up the rest of the route.

Click Routes in the sidebar, then Create Route. Fill in:

Drawing the route

Click Draw Route Shape, then click on the map to place vertices along the alignment. Double-click to finish. The drawing tool has two modes:

To edit an existing shape: click the route in the sidebar, open its Shapes tab, and click Edit Shape on the one you want. Drag any vertex to move it, click between two vertices to insert a new one, select-and-Delete to remove, then Save (or Cancel to discard). The same row carries the rest of the per-shape tools: Simplify (reduces vertex count with the Douglas-Peucker algorithm — useful when a snap-to-road shape has more vertices than you need), Trim, re-Snap, Duplicate (see below), a visibility toggle, and delete.

You can also jump straight in from the map: clicking a route line opens a popup with Edit Route, Edit Stops (opens the route's Stops sub-panel), and a timetable shortcut, plus a pencil icon to edit the clicked shape directly. Handy when you've spotted something on the map and want to fix it without hunting through the sidebar.

Multiple shape variants

Most routes need at least two shapes: one for the outbound direction, one for inbound. The two often differ because one-way streets, turn restrictions, or stop pairs offset across the road force the bus to take slightly different paths each direction.

In the editor, the direction picker at the top of the route's shape panel toggles between direction 0 and direction 1. Draw separate shapes for each — they share the route_id but get distinct shape_ids on export. Each trip in the timetable then references the shape_id that matches its direction.

Loops and branches are also supported: a single direction can have multiple shape variants if the route runs different paths at different times of day (a peak express variant, a weekend deviation, etc.). The editor surfaces these as additional shapes under the same route.

When a route has several shapes, give them names so you can tell them apart at a glance. Each shape in the Shapes tab has an editable name field — type something like "Outbound — express" or "Weekend deviation" and it sticks with that shape. The name is an editor convenience for keeping variants straight; the exported feed still keys everything on the generated shape_id. Those names are also what the timetable's pattern dropdown and the Stops sub-panel show, so naming variants pays off the moment you have more than one per direction.

Each shape owns its own stops

Stops are keyed per shape, not per direction. A route's outbound-express shape and its outbound-local shape can serve different stop lists, in a different order, even though both are "direction 0". This is what lets a short-turn variant visit a subset of the line, or an express skip the locals — the stops belong to the shape, not the whole route.

The Stops sub-panel (on the route's detail panel, and via Edit Stops below) follows the same selector as the timetable: a shape dropdown that lists each shape by name, so you place and reorder stops for the shape you've selected. Pick the shape first, then add or drag its stops.

Duplicating a shape (with options)

The per-shape Duplicate button clones a shape's geometry into a new shape on the same route, and opens a small options popover:

The duplicate also gets a minimal stub trip (same direction, service, and headsign with "(copy)" appended) so the new shape shows up immediately as a pattern you can edit in the timetable — reassign or rename it there. The typical move is draw outbound → duplicate with reverse + copy stops → refine the inbound path, which gets you both directions in a couple of clicks instead of redrawing.

Picking a route type

The GTFS spec defines eight basic route types: bus (3), light rail (0), subway (1), rail (2), ferry (4), cable car (5), aerial lift (6), funicular (7). Pick the one that matches the rider's experience, not the operator's classification. A "bus rapid transit" service stays type=3 (bus); it's marketed as rail-like but legally still a bus. A "trolley" running on rails is light rail (0); a "trolley bus" running on rubber tires with overhead wires is bus (3).

For services that don't fit cleanly (an aerial gondola on a transit network, a Brightline-style intercity train), the spec defines an extended set of route types in the 100–1700 range. The editor preserves these on import/export but doesn't expose them in the dropdown — for now, edit the imported value through the JSON inspector if you need one.

Edge cases and gotchas

See also