Skip to content

GTFS-Fares v2 Zone-based fares #344

@omar-kabbani

Description

@omar-kabbani

Hi everyone - we (MobilityData) are looking to add zone-based fares to GTFS as part of GTFS-Fares v2.

This requires the following changes:

  • Add the field contains_area_id to fare_leg_rules.txt
  • Add the field greater_area_id somewhere

Below is an example of how we envision the files and fields being used to describe zone-based fares.

Step 1: Define Zones

Consider a system with four zones; A, B, C, and D:

  • A → B costs 3 CAD
  • B → C costs 2 CAD
  • C → D costs 1 CAD
  • A → C (though B) costs 4.5 CAD
  • A → D (though B and C) costs 5.5 CAD

Use areas.txt to create the fare zones:

areas.txt

area_id area_name
A Area A
B Area B
C Area C
D Area D

Step 2: Group zones

Grouping zones is necessary to describe zone-based fares that cross more than three zones. The origin zone is listed under from_area_id, the destination zone is listed under to_area_id, and the zones in between are grouped and listed under contains_area_id. In the original proposal, the file stop_areas.txt is used to to assign stops to areas and to group areas together using greater_area_id. However, this would probably get messy with three different layers being present in one file (stops, areas, and greater areas).

One option would be to have a new file to assign areas to greater areas:

area_id greater_area_id
B areaBC
C areaBC

Another alternative would be to use the file areas.txt to assign areas to greater areas - the only downside to that is that an area cannot be assigned to more than one greater area.

Step 3: Define fare legs

Use fare_leg_rules.txt to define the cost of travel between the different zones:

from_area_id to_area_id contains_area_id fare_product_id
A B 3_dollar
B C 2_dollar
C D 1_dollar
A C B 4.5_dollar
A D BC 5.5_dollar

Any thoughts on how this example models zone-based fares? Is this in line with the expectations of data consumers and data producers? We would also like to hear your suggestions around greater_area_id.

Please share your thoughts here so we can come up with a way to move forward with zone-based fares.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Discussion PeriodThe community engages in conversations to help refine and develop the proposal.GTFS ScheduleIssues and Pull Requests that focus on GTFS ScheduleGTFS-FaresIssues and Pull Requests that focus on GTFS-Fares Extension

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions