Skip to content

GTFS-Flex

Status April 2024. You can find information on continuous adjustments in our changelog.

Background

What is GTFS-Flex?

A detailed description of the superordinate General Transit Feed Specification (GTFS(-Static)) can be found HERE. GTFS basically describes the public transport timetables and associated geographical information, such as the locations of stops.

Over the course of time, various so-called extensions have been defined. One of the extensions is GTFS-Flex. GTFS-Flex should be used accordingly with GTFS-Static.

Who is behind it?

GTFS-Flex is designed to make it easier to find on-demand transport services.

With its acceptance on 18 March 2024, GTFS-Flex changed from a “proposal” to an official extension of GTFS-Static.

Why does the Open Data platform offer this?

On behalf of the Federal Office of Transport (FOT), the System Tasks Customer Information Plus (SKI+) office aims to provide as many of the current standards as possible.

In addition to GTFS-Flex, we also offer the on-demand services as NeTEx.

How do I access the data/interfaces?

Data

GTFS-Flex: https://opentransportdata.swiss/en/dataset/gtfsflex

GTFS-Static (changes every year, here 2024): https://opentransportdata.swiss/en/dataset/timetable-2024-gtfs2020

Interface

GTFS-Flex is offered as a file and should be used together with GTFS-Static.

Technical description

What information do we map with GTFS-Flex? Size:

GTFS-Flex extends GTFS as it allows the different forms of on-demand offers to be displayed. These include: on-demand scheduled transport, on-demand corridor transport and on-demand surface transport. More on this in the On-Demand technical concept (see further information).

In addition, the extension makes it possible to map the service areas (geographical areas) that are important for area transport and to map services as time windows (instead of fixed departure and arrival times).

How is the information structured? The model.

Like GTFS, GTFS-Flex is made up of several files. We have also adapted the standard to include some aspects relevant to Switzerland and summarised them in a Swiss profile (see further information).

Technical description (What is in the GTFS Flex files? (Contents))

The following table is taken from the Swiss GTFS profile. The profile is considered a master’s degree.

No Filename Required Definition
1 agency.txt Required Transit agencies with service represented in this dataset
2 stops.txt Required Stops where vehicles pick up or drop off riders. Also defines stations and station entrances.
3 routes.txt Required Transit routes. A route is a group of trips that are displayed to riders as a single service
4 trips.txt Required Trips for each route. A trip is a sequence of two or more stops that occur during a specific time period.
5 stop_times.txt Required Extended and modified file to include time-windows that a vehicle picks up and drops off at stops or location groups/areas.
6 calendar.txt Conditionally Required Service dates specified using a weekly schedule with start and end dates. This file is required unless all dates of service are defined in calendar.txt
7 calendar_dates.txt Conditionally Required Exceptions for the services defined in the calendar.txt. If calendar.txt is omitted, then calendar_dates.txt is required and must contain all dates of service.
8 transfers.txt Optional When calculating an itinerary, GTFS-consuming applications interpolate transfers based on allowable time and stop proximity
9 feed_info.txt Optional This file contains information about the dataset itself, rather than the service the dataset describes
10 booking_rules.txt Required New file that defines the booking rules / requirements that must be met for a successful booking
11 locations.geojson Required New GeoJSON (and non-CSV) formatted file that allows defining Zones using Polygons and MultiPolygons (for Zones with “holes”).
12 location_groups Required New files to allow grouping of stops which allow predetermined groups of these features to be specified on individual rows of stop_times.txt.

This file specifically defines the group.

13 location_group_stops Required New files to allow grouping of stops which allow predetermined groups of these features to be specified on individual rows of stop_times.txt.

This file specifically defines the mapping of the groups from location_groups to stops.

Restrictions and further information

Restrictions

  • GTFS-Flex does not cover all aspects of on-demand services, which is why an extension of GTFS-Flex (thus an extension of the extension) is currently being sought: https://share.mobilitydata.org/gtfs-ondemand
  • GTFS-Flex, like the other GTFS-* standards, does not offer a booking mechanism, i.e. no price information

Further information