PTNA - Public Transport Network Analysis

Static Analysis for OpenStreetMap


What is GTFS data?

GTFS data ... Quoted from von Google's Web-Site GTFS:

"The General Transit Feed Specification (GTFS), also known as GTFS static or static transit to differentiate it from the GTFS realtime extension, defines a common format for public transportation schedules and associated geographic information. GTFS "feeds" let public transit agencies publish their transit data and developers write applications that consume that data in an interoperable way."

The GTFS data consists of a series of *.txt files packed in a *.zip archive. The data in the *.txt files is structured as CSV data. The different files can be used as database tables. PTNA's GTFS analysis uses the simple, file-based SQLite software.

  • feed_info.txt
    essentially contains information about the publisher (owner) of the data as well as optional information about the version and validity period of the data.
  • agency.txt
    contains information about the transit agency. The 'agencies' listed can be interpreted in the OSM sense as 'network' or 'operator'. This depends on what the publisher of the data means by 'transit agency'.
  • routes.txt
    contains information about...
  • trips.txt
    contains information about...
  • stops.txt
    contains information about...
  • stop_times.txt
    contains information about...
  • shapes.txt
    contains information about...
  • calendar.txt
    contains information about...
  • calendar_dates.txt
    contains information about...

Updating the data

The data on this page is updated only at irregular intervals for several reasons:

  • Some networks make new versions available almost daily without specifying a date.
  • Some networks provide data at very irregular intervals.
  • Some data can be downloaded directly and always via the same link.
  • Some data can only be downloaded indirectly via, per version, always different links - to prevent automated loading?
  • At least the download can't be automated easily.
  • Public transport relations should have a long-term character in OSM. Does it make sense to map every construction site related change of a bus line in OSM to undo this later on?

Preparation of GTFS data

The GTFS data of the transport authority are prepared for use in PTNA.

  • Table "osm"
    • Add OSM-specific information as a separate table.
      • Value of 'network' for PT relations (e.g. "Münchner Verkehrs- und Tarifverbund").
      • Value of 'network:short' for PT relations (e.g. "MVV").
      • Value of 'network:guid' for PT relations (e.g. "DE-BY-MVV").
      • Value of 'operator for PT relations: can "agency_name" from the GTFS table "agency.txt" be used as 'operator'?
  • Table "ptna"
    • Add PTNA-specific information as a separate table.
  • Other tables
    • The field 'ptna_comment' is added. This can be used to enter comments - see "Analysis of GTFS data.

Aggregation of GTFS data

The GTFS data of the transport association are processed for PTNA. The aim is to reduce the amount of data to enable fast searches in the GTFS data.

  • Table "ptna_aggregation"
    • Add PTNA-specific information to the aggregation as a separate table.
  • Table "routes"
    • Delete all "route_id" that are no longer valid (end of validity before the time of aggregation/download).
  • Table "trips"
    • Delete all "trip_id" that are no longer valid (end of validity before the time of aggregation/download)
  • Table "stop_times"
    • Delete all redundant "trip_id", those with identical routes that differ only in departure times. Reduce to a single "trip_id" (the first "trip_id" found).

Analysis of GTFS data

The GTFS data of the transport association are processed for PTNA. The aim is to find out which route (trip) is a subroute of another route.

  • Table "ptna_analysis"
    • Add PTNA-specific information to the analysis as a separate table.
  • Table "trips"
    • ...

Normalization of GTFS data

The GTFS data of the transport association are processed for PTNA. The aim is to achieve a uniform spelling for stop names.

  • "str." => "straße"
  • "Str." => "Straße"
  • "Pl." => "Platz"
  • ...