Data Flow
Startup Sequence
GTFS Data Model
Glove loads the following GTFS files:
| File | Content | Rust Struct |
|---|---|---|
agency.txt | Transit agencies | Agency |
routes.txt | Transit routes (lines) | Route |
stops.txt | Stop locations | Stop |
trips.txt | Individual trips | Trip |
stop_times.txt | Arrival/departure at each stop | StopTime |
calendar.txt | Weekly service schedules | Calendar |
calendar_dates.txt | Service exceptions | CalendarDate |
transfers.txt | Transfer connections between stops | Transfer |
Query Flow
Public Transit Journey
Walk / Bike / Car Journey
Hot Reload
The hot reload mechanism allows updating GTFS data without downtime:
POST /api/gtfs/reloadis called (requiresapi_key)- A background thread loads new GTFS data and builds a fresh RAPTOR index
- The new index is swapped in atomically via
ArcSwap - All in-flight requests continue using the old index until they complete
- The old index is dropped when the last reference is released
Transfer Enrichment
When maneuvers=true is requested, transfer sections in public transport journeys are enriched with Valhalla walking routes. The enrichment logic depends on the transfer type:
- Outdoor transfers (stops with different
parent_station): Valhalla is always called to obtain the actual walking route shape, which is displayed on the map as a polyline. - Indoor transfers (stops sharing the same
parent_station): Valhalla is only called when indoor maneuvers (elevator, stairs, escalator) exist in OSM data for that station. - Polyline rendering: transfer sections use the Valhalla shape (actual walking route) when available; otherwise a straight line is drawn between the two stops.
Transfer enrichment calls are batched in parallel using futures::join_all for performance. When maneuvers is not requested (the default), transfer Valhalla enrichment is skipped entirely