From b279149682fa784a5ae321eaebc20bf7802773b0 Mon Sep 17 00:00:00 2001 From: omar-kabbani <78552622+omar-kabbani@users.noreply.github.com> Date: Thu, 4 Aug 2022 17:37:59 -0400 Subject: [PATCH 01/38] Add fare containers to reference.md --- gtfs/spec/en/reference.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index b3c39ec39..1c88ef02c 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -19,6 +19,7 @@ This document defines the format and structure of the files that comprise a GTFS - [calendar\_dates.txt](#calendar_datestxt) - [fare\_attributes.txt](#fare_attributestxt) - [fare\_rules.txt](#fare_rulestxt) + - [fare\_containers.txt](#fare_containerstxt) - [fare\_products.txt](#fare_productstxt) - [fare\_leg\_rules.txt](#fare_leg_rulestxt) - [fare\_transfer\_rules.txt](#fare_transfer_rulestxt) @@ -343,6 +344,23 @@ For examples that demonstrate how to specify a fare structure with [fare_rules.t | `destination_id` | Foreign ID referencing `stops.zone_id` | Optional | Identifies a destination zone. If a fare class has multiple destination zones, create a record in [fare_rules.txt](#fare_rules.txt) for each `destination_id`.
*Example: The `origin_id` and `destination_id` fields could be used together to specify that fare class "b" is valid for travel between zones 3 and 4, and for travel between zones 3 and 5, the [fare_rules.txt](#fare_rules.txt) file would contain these records for the fare class:*
`fare_id,...,origin_id,destination_id`
`b,...,3,4`
`b,...,3,5` | | `contains_id` | Foreign ID referencing `stops.zone_id` | Optional | Identifies the zones that a rider will enter while using a given fare class. Used in some systems to calculate correct fare class.
*Example: If fare class "c" is associated with all travel on the GRT route that passes through zones 5, 6, and 7 the [fare_rules.txt](#fare_rules.txt) would contain these records:*
`fare_id,route_id,...,contains_id`
`c,GRT,...,5`
`c,GRT,...,6`
`c,GRT,...,7`
*Because all `contains_id` zones must be matched for the fare to apply, an itinerary that passes through zones 5 and 6 but not zone 7 would not have fare class "c". For more detail, see [https://code.google.com/p/googletransitdatafeed/wiki/FareExamples](https://code.google.com/p/googletransitdatafeed/wiki/FareExamples) in the GoogleTransitDataFeed project wiki.* | +### fare_containers.txt + +To describe fare containers, which are used to load fare products such as tickets, passes, and discounted fares. + +File: **Optional** + +Primary Key (`fare_container_id`) + +| Field Name | Type | Presence | Description | +| ------ | ------ | ------ | ------ | +| `fare_container_id` | Unique ID | **Required** | Identifies a fare container. | +| `fare_container_name` | Text | Optional | The name of the fare container as displayed to riders. | +| `amount` | Non-negative currency amount | Optional | The cost of the fare container. | +| `minimum_initial_purchase` | Non-negative currency amount | Optional | The cost of the minimum initial purchase required on the fare container. | +| `currency` | Currency code | **Conditionally Required** | The currency of `fare_containers.amount` or `fare_containers.minimum_initial_purchase`.
Conditionally Required:
- **Required** if `fare_containers.amount` or `fare_containers.minimum_initial_purchase` are defined.
- **Forbidden** if `fare_containers.amount` and `fare_containers.minimum_initial_purchase` are empty. | + + ### fare_products.txt File: **Optional** @@ -357,6 +375,8 @@ To describe the different types of tickets or fares that can be purchased by rid | `fare_product_name` | Text | Optional | The name of the fare product as displayed to riders. | | `amount` | Currency amount | **Required** | The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free.| | `currency` | Currency code | **Required** | The currency of the cost of the fare product. | +| `fare_container_id` | Foreign ID referencing `fare_containers.fare_container_id` | Optional | Identifies the fare container that the fare product can be loaded on. If this field is left blank, the record corresponds to a fare product that is purchased outside of a fare container. | + ### fare_leg_rules.txt From a1eb24e6f7da66e7fcebc1ff63bf4b486e51eb9c Mon Sep 17 00:00:00 2001 From: omar-kabbani <78552622+omar-kabbani@users.noreply.github.com> Date: Fri, 5 Aug 2022 11:41:56 -0400 Subject: [PATCH 02/38] Update documentation Clearly indicate that fare_containers.txt falls under GTFS-Fares v2 and not v1 Add fare_containers to the dataset files table --- gtfs/spec/en/reference.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 1c88ef02c..0eea9bfef 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -110,6 +110,7 @@ This specification defines the following files: | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | | [fare_rules.txt](#fare_rulestxt) | **Conditionally Required** | Rules to apply fares for itineraries.

Conditionally Required:
- **Required** if [fare_attributes.txt](#fare_attributestxt) is defined.
- **Forbidden** otherwise. | +| [fare_containers.txt](#fare_containerstxt) | Optional |To describe fare containers, which are used to load fare products such as tickets, passes, and discounted fares.

File [fare_containers.txt](fare_containerstxt) describes fare containers that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_containers.txt](#fare_containerstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | @@ -308,7 +309,7 @@ File: **Optional** Primary key (`fare_id`) **Versions**
-There are two modelling options for describing fares. GTFS-Fares V1 is the legacy option for describing minimal fare information. GTFS-Fares V2 is an updated method that allows for a more detailed account of an agency's fare structure. Both are allowed to be present in a dataset, but only one method should be used by a data consumer for a given dataset. It is recommended that GTFS-Fares V2 takes precedence over GTFS-Fares V1.

The files associated with GTFS-Fares V1 are:
- [fare_attributes.txt](#fare_attributestxt)
- [fare_rules.txt](#fare_rulestxt)

The files associated with GTFS-Fares V2 are:
- [fare_products.txt](#fare_productstxt)
- [fare_leg_rules.txt](#fare_leg_rulestxt)
- [fare_transfer_rules.txt](#fare_transfer_rulestxt) +There are two modelling options for describing fares. GTFS-Fares V1 is the legacy option for describing minimal fare information. GTFS-Fares V2 is an updated method that allows for a more detailed account of an agency's fare structure. Both are allowed to be present in a dataset, but only one method should be used by a data consumer for a given dataset. It is recommended that GTFS-Fares V2 takes precedence over GTFS-Fares V1.

The files associated with GTFS-Fares V1 are:
- [fare_attributes.txt](#fare_attributestxt)
- [fare_rules.txt](#fare_rulestxt)

The files associated with GTFS-Fares V2 are:
- [fare_containers.txt](#fare_containerstxt)
- [fare_products.txt](#fare_productstxt)
- [fare_leg_rules.txt](#fare_leg_rulestxt)
- [fare_transfer_rules.txt](#fare_transfer_rulestxt)
From 7a978bb1960bd24ffcd40eb2f94d5f6fa6270f28 Mon Sep 17 00:00:00 2001 From: isabelle-dr <63653518+isabelle-dr@users.noreply.github.com> Date: Tue, 1 Nov 2022 16:44:09 -0400 Subject: [PATCH 03/38] Update primary key of fare_products.txt --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 0eea9bfef..cbd8e9fd6 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -366,7 +366,7 @@ Primary Key (`fare_container_id`) File: **Optional** -Primary Key (`fare_product_id`) +Primary Key (`fare_product_id`, `fare_container_id`) To describe the different types of tickets or fares that can be purchased by riders. From 58dd6bbaf1662b8560d02068800a46af64b5f130 Mon Sep 17 00:00:00 2001 From: isabelle-dr <63653518+isabelle-dr@users.noreply.github.com> Date: Thu, 10 Nov 2022 16:49:33 -0500 Subject: [PATCH 04/38] improve definitions --- gtfs/spec/en/reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index cbd8e9fd6..030b1b6c3 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,8 +357,8 @@ Primary Key (`fare_container_id`) | ------ | ------ | ------ | ------ | | `fare_container_id` | Unique ID | **Required** | Identifies a fare container. | | `fare_container_name` | Text | Optional | The name of the fare container as displayed to riders. | -| `amount` | Non-negative currency amount | Optional | The cost of the fare container. | -| `minimum_initial_purchase` | Non-negative currency amount | Optional | The cost of the minimum initial purchase required on the fare container. | +| `amount` | Non-negative currency amount | Optional | The cost to acquire the fare container. Does not include any amount that could be used as a fare. | +| `minimum_initial_purchase` | Non-negative currency amount | Optional | The amount of the minimum fare purchase required when acquiring the container. | | `currency` | Currency code | **Conditionally Required** | The currency of `fare_containers.amount` or `fare_containers.minimum_initial_purchase`.
Conditionally Required:
- **Required** if `fare_containers.amount` or `fare_containers.minimum_initial_purchase` are defined.
- **Forbidden** if `fare_containers.amount` and `fare_containers.minimum_initial_purchase` are empty. | From c946316d063e8cebcd5a145149659691d3c4ed16 Mon Sep 17 00:00:00 2001 From: isabelle-dr <63653518+isabelle-dr@users.noreply.github.com> Date: Thu, 10 Nov 2022 17:14:19 -0500 Subject: [PATCH 05/38] fare_container_type --- gtfs/spec/en/reference.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 030b1b6c3..ca32ffa61 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,7 +357,8 @@ Primary Key (`fare_container_id`) | ------ | ------ | ------ | ------ | | `fare_container_id` | Unique ID | **Required** | Identifies a fare container. | | `fare_container_name` | Text | Optional | The name of the fare container as displayed to riders. | -| `amount` | Non-negative currency amount | Optional | The cost to acquire the fare container. Does not include any amount that could be used as a fare. | +| `fare_container_type` | Enum | Optional | The type of the fare container.
Valid options are:

`0` - Physical card.
`1` - Mobile app.
`2` - Both.| +| `amount` | Non-negative currency amount | Optional | The cost to acquire the fare container. Does not include any amount that could be used as a fare.| | `minimum_initial_purchase` | Non-negative currency amount | Optional | The amount of the minimum fare purchase required when acquiring the container. | | `currency` | Currency code | **Conditionally Required** | The currency of `fare_containers.amount` or `fare_containers.minimum_initial_purchase`.
Conditionally Required:
- **Required** if `fare_containers.amount` or `fare_containers.minimum_initial_purchase` are defined.
- **Forbidden** if `fare_containers.amount` and `fare_containers.minimum_initial_purchase` are empty. | From ee8c6709bace92e01e3cf70098c4b94b0f70f500 Mon Sep 17 00:00:00 2001 From: isabelle-dr <63653518+isabelle-dr@users.noreply.github.com> Date: Thu, 10 Nov 2022 17:15:50 -0500 Subject: [PATCH 06/38] add digital card option --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index ca32ffa61..05788c4ef 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,7 +357,7 @@ Primary Key (`fare_container_id`) | ------ | ------ | ------ | ------ | | `fare_container_id` | Unique ID | **Required** | Identifies a fare container. | | `fare_container_name` | Text | Optional | The name of the fare container as displayed to riders. | -| `fare_container_type` | Enum | Optional | The type of the fare container.
Valid options are:

`0` - Physical card.
`1` - Mobile app.
`2` - Both.| +| `fare_container_type` | Enum | Optional | The type of the fare container.
Valid options are:

`0` - Physical card.
`1` - Digital card or mobile app.
`2` - Both.| | `amount` | Non-negative currency amount | Optional | The cost to acquire the fare container. Does not include any amount that could be used as a fare.| | `minimum_initial_purchase` | Non-negative currency amount | Optional | The amount of the minimum fare purchase required when acquiring the container. | | `currency` | Currency code | **Conditionally Required** | The currency of `fare_containers.amount` or `fare_containers.minimum_initial_purchase`.
Conditionally Required:
- **Required** if `fare_containers.amount` or `fare_containers.minimum_initial_purchase` are defined.
- **Forbidden** if `fare_containers.amount` and `fare_containers.minimum_initial_purchase` are empty. | From 06c00e92549970a3edc35dd83c3069d130180416 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Wed, 7 Dec 2022 22:40:43 -0500 Subject: [PATCH 07/38] replace with new proposal - replaced container with payment type - made fare_payment_type required - changed the id to fare_payment_type_group as a non-unique ID field --- gtfs/spec/en/reference.md | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 05788c4ef..f7eb80d2d 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -19,7 +19,7 @@ This document defines the format and structure of the files that comprise a GTFS - [calendar\_dates.txt](#calendar_datestxt) - [fare\_attributes.txt](#fare_attributestxt) - [fare\_rules.txt](#fare_rulestxt) - - [fare\_containers.txt](#fare_containerstxt) + - [fare\_payment\_types.txt](#fare_payment_typestxt) - [fare\_products.txt](#fare_productstxt) - [fare\_leg\_rules.txt](#fare_leg_rulestxt) - [fare\_transfer\_rules.txt](#fare_transfer_rulestxt) @@ -110,7 +110,7 @@ This specification defines the following files: | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | | [fare_rules.txt](#fare_rulestxt) | **Conditionally Required** | Rules to apply fares for itineraries.

Conditionally Required:
- **Required** if [fare_attributes.txt](#fare_attributestxt) is defined.
- **Forbidden** otherwise. | -| [fare_containers.txt](#fare_containerstxt) | Optional |To describe fare containers, which are used to load fare products such as tickets, passes, and discounted fares.

File [fare_containers.txt](fare_containerstxt) describes fare containers that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_containers.txt](#fare_containerstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | +| [fare_payment_types.txt](#fare_payment_typestxt) | Optional |To describe fare payment types associated with fare products.

File [fare_payment_types.txt](fare_payment_typestxt) describes fare payment types that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_types.txt](#fare_payment_typestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | @@ -309,7 +309,7 @@ File: **Optional** Primary key (`fare_id`) **Versions**
-There are two modelling options for describing fares. GTFS-Fares V1 is the legacy option for describing minimal fare information. GTFS-Fares V2 is an updated method that allows for a more detailed account of an agency's fare structure. Both are allowed to be present in a dataset, but only one method should be used by a data consumer for a given dataset. It is recommended that GTFS-Fares V2 takes precedence over GTFS-Fares V1.

The files associated with GTFS-Fares V1 are:
- [fare_attributes.txt](#fare_attributestxt)
- [fare_rules.txt](#fare_rulestxt)

The files associated with GTFS-Fares V2 are:
- [fare_containers.txt](#fare_containerstxt)
- [fare_products.txt](#fare_productstxt)
- [fare_leg_rules.txt](#fare_leg_rulestxt)
- [fare_transfer_rules.txt](#fare_transfer_rulestxt) +There are two modelling options for describing fares. GTFS-Fares V1 is the legacy option for describing minimal fare information. GTFS-Fares V2 is an updated method that allows for a more detailed account of an agency's fare structure. Both are allowed to be present in a dataset, but only one method should be used by a data consumer for a given dataset. It is recommended that GTFS-Fares V2 takes precedence over GTFS-Fares V1.

The files associated with GTFS-Fares V1 are:
- [fare_attributes.txt](#fare_attributestxt)
- [fare_rules.txt](#fare_rulestxt)

The files associated with GTFS-Fares V2 are:
- [fare_payment_types.txt](#fare_payment_typestxt)
- [fare_products.txt](#fare_productstxt)
- [fare_leg_rules.txt](#fare_leg_rulestxt)
- [fare_transfer_rules.txt](#fare_transfer_rulestxt)
@@ -345,39 +345,35 @@ For examples that demonstrate how to specify a fare structure with [fare_rules.t | `destination_id` | Foreign ID referencing `stops.zone_id` | Optional | Identifies a destination zone. If a fare class has multiple destination zones, create a record in [fare_rules.txt](#fare_rules.txt) for each `destination_id`.
*Example: The `origin_id` and `destination_id` fields could be used together to specify that fare class "b" is valid for travel between zones 3 and 4, and for travel between zones 3 and 5, the [fare_rules.txt](#fare_rules.txt) file would contain these records for the fare class:*
`fare_id,...,origin_id,destination_id`
`b,...,3,4`
`b,...,3,5` | | `contains_id` | Foreign ID referencing `stops.zone_id` | Optional | Identifies the zones that a rider will enter while using a given fare class. Used in some systems to calculate correct fare class.
*Example: If fare class "c" is associated with all travel on the GRT route that passes through zones 5, 6, and 7 the [fare_rules.txt](#fare_rules.txt) would contain these records:*
`fare_id,route_id,...,contains_id`
`c,GRT,...,5`
`c,GRT,...,6`
`c,GRT,...,7`
*Because all `contains_id` zones must be matched for the fare to apply, an itinerary that passes through zones 5 and 6 but not zone 7 would not have fare class "c". For more detail, see [https://code.google.com/p/googletransitdatafeed/wiki/FareExamples](https://code.google.com/p/googletransitdatafeed/wiki/FareExamples) in the GoogleTransitDataFeed project wiki.* | -### fare_containers.txt +### fare_payment_types.txt -To describe fare containers, which are used to load fare products such as tickets, passes, and discounted fares. +To describe fare payment types to be associated with fare products. File: **Optional** -Primary Key (`fare_container_id`) +Primary Key (`fare_payment_type_group_id`) | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | -| `fare_container_id` | Unique ID | **Required** | Identifies a fare container. | -| `fare_container_name` | Text | Optional | The name of the fare container as displayed to riders. | -| `fare_container_type` | Enum | Optional | The type of the fare container.
Valid options are:

`0` - Physical card.
`1` - Digital card or mobile app.
`2` - Both.| -| `amount` | Non-negative currency amount | Optional | The cost to acquire the fare container. Does not include any amount that could be used as a fare.| -| `minimum_initial_purchase` | Non-negative currency amount | Optional | The amount of the minimum fare purchase required when acquiring the container. | -| `currency` | Currency code | **Conditionally Required** | The currency of `fare_containers.amount` or `fare_containers.minimum_initial_purchase`.
Conditionally Required:
- **Required** if `fare_containers.amount` or `fare_containers.minimum_initial_purchase` are defined.
- **Forbidden** if `fare_containers.amount` and `fare_containers.minimum_initial_purchase` are empty. | - +| `fare_payment_type_group_id` | ID | **Required** | Identifies a fare payment type group. | +| `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2)or mobile apps (`fare_payment_type` =2), the `fare_payment_type_name` should match the rider-facing names used by the organizations delivering them. | +| `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash.
`1` - contactless payment via bank cards.
`2` - transit card (contactless or not).
`3` mobile app - | ### fare_products.txt File: **Optional** -Primary Key (`fare_product_id`, `fare_container_id`) +Primary Key (`fare_product_id`, `fare_payment_type_group_id`) To describe the different types of tickets or fares that can be purchased by riders. | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | -| `fare_product_id` | ID | **Required** | Identifies a fare product. | +| `fare_product_id` | ID | **Required** | Identifies a fare product. | | `fare_product_name` | Text | Optional | The name of the fare product as displayed to riders. | | `amount` | Currency amount | **Required** | The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free.| | `currency` | Currency code | **Required** | The currency of the cost of the fare product. | -| `fare_container_id` | Foreign ID referencing `fare_containers.fare_container_id` | Optional | Identifies the fare container that the fare product can be loaded on. If this field is left blank, the record corresponds to a fare product that is purchased outside of a fare container. | +| `fare_payment_type_group_id` | Foreign ID referencing `fare_payment_types.fare_payment_type_group_id` | Optional | Identifies the fare payment types that can be used to pay for the `fare_product` for the trip. | ### fare_leg_rules.txt From 4a5d329002252fbe94fd48c42a9f9ef88a6426d7 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Thu, 8 Dec 2022 09:48:33 -0500 Subject: [PATCH 08/38] typo --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index f7eb80d2d..a55324942 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -356,7 +356,7 @@ Primary Key (`fare_payment_type_group_id`) | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_payment_type_group_id` | ID | **Required** | Identifies a fare payment type group. | -| `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2)or mobile apps (`fare_payment_type` =2), the `fare_payment_type_name` should match the rider-facing names used by the organizations delivering them. | +| `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2)or mobile apps (`fare_payment_type` =3), the `fare_payment_type_name` should match the rider-facing names used by the organizations delivering them. | | `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash.
`1` - contactless payment via bank cards.
`2` - transit card (contactless or not).
`3` mobile app - | ### fare_products.txt From 5474fbde1e06195eabc2e96bbc3cc7c128a92b2c Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Fri, 9 Dec 2022 09:24:00 -0500 Subject: [PATCH 09/38] improve descriptions --- gtfs/spec/en/reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index a55324942..03dcd9d4f 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -356,8 +356,8 @@ Primary Key (`fare_payment_type_group_id`) | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_payment_type_group_id` | ID | **Required** | Identifies a fare payment type group. | -| `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2)or mobile apps (`fare_payment_type` =3), the `fare_payment_type_name` should match the rider-facing names used by the organizations delivering them. | -| `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash.
`1` - contactless payment via bank cards.
`2` - transit card (contactless or not).
`3` mobile app - | +| `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2)or mobile apps (`fare_payment_type` =3), the `fare_payment_type_name` should be included and should match the rider-facing names used by the organizations delivering them. | +| `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash.
`1` - Contactless payment via bank cards (physical or in a virtual wallet).
`2` - Transit card (physical or virtual).
`3` - Mobile app | ### fare_products.txt From c9724c6e6101097f2d55e22f6c46d4edd1587f47 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 12 Dec 2022 13:46:18 -0500 Subject: [PATCH 10/38] Fix primary key of fare_payment_types.txt --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 03dcd9d4f..d937e07be 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -351,7 +351,7 @@ To describe fare payment types to be associated with fare products. File: **Optional** -Primary Key (`fare_payment_type_group_id`) +Primary Key (`*`) | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | From 1da76911c59c2c66f4634949806f07d6715fd263 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 19 Dec 2022 10:27:48 -0500 Subject: [PATCH 11/38] Update descriptions --- gtfs/spec/en/reference.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index d937e07be..0afd541d7 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,7 +357,8 @@ Primary Key (`*`) | ------ | ------ | ------ | ------ | | `fare_payment_type_group_id` | ID | **Required** | Identifies a fare payment type group. | | `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2)or mobile apps (`fare_payment_type` =3), the `fare_payment_type_name` should be included and should match the rider-facing names used by the organizations delivering them. | -| `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash.
`1` - Contactless payment via bank cards (physical or in a virtual wallet).
`2` - Transit card (physical or virtual).
`3` - Mobile app | +| `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash (notes and coins).
`1` - Contactless payment via bank cards (physical or in a virtual wallet).
`2` - Transit card used to store fare value (physical or virtual). +
`3` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip. | ### fare_products.txt From 6b1321731d7f307b68f28ba96d8258b566f040c0 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 19 Dec 2022 10:37:22 -0500 Subject: [PATCH 12/38] format table --- gtfs/spec/en/reference.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 0afd541d7..25d4ecf39 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,8 +357,7 @@ Primary Key (`*`) | ------ | ------ | ------ | ------ | | `fare_payment_type_group_id` | ID | **Required** | Identifies a fare payment type group. | | `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2)or mobile apps (`fare_payment_type` =3), the `fare_payment_type_name` should be included and should match the rider-facing names used by the organizations delivering them. | -| `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash (notes and coins).
`1` - Contactless payment via bank cards (physical or in a virtual wallet).
`2` - Transit card used to store fare value (physical or virtual). -
`3` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip. | +| `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash (notes and coins).
`1` - Contactless payment via bank cards (physical or virtual).
`2` - Transit card used to store fare value (physical or virtual).
`3` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip.| ### fare_products.txt From 82d06058120b6619f137cabda0dce859069b5d70 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 19 Dec 2022 10:39:22 -0500 Subject: [PATCH 13/38] add space --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 25d4ecf39..aa37cf810 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -356,7 +356,7 @@ Primary Key (`*`) | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_payment_type_group_id` | ID | **Required** | Identifies a fare payment type group. | -| `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2)or mobile apps (`fare_payment_type` =3), the `fare_payment_type_name` should be included and should match the rider-facing names used by the organizations delivering them. | +| `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2) or mobile apps (`fare_payment_type` =3), the `fare_payment_type_name` should be included and should match the rider-facing names used by the organizations delivering them. | | `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash (notes and coins).
`1` - Contactless payment via bank cards (physical or virtual).
`2` - Transit card used to store fare value (physical or virtual).
`3` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip.| ### fare_products.txt From e30461ed7e5bfd50df7844be1a74dcc513e723b7 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 19 Dec 2022 20:54:47 -0500 Subject: [PATCH 14/38] Change fare payment type to fare payment option --- gtfs/spec/en/reference.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index aa37cf810..cdaf4b7b2 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -19,7 +19,7 @@ This document defines the format and structure of the files that comprise a GTFS - [calendar\_dates.txt](#calendar_datestxt) - [fare\_attributes.txt](#fare_attributestxt) - [fare\_rules.txt](#fare_rulestxt) - - [fare\_payment\_types.txt](#fare_payment_typestxt) + - [fare\_payment_options.txt](#fare_payment_optionstxt) - [fare\_products.txt](#fare_productstxt) - [fare\_leg\_rules.txt](#fare_leg_rulestxt) - [fare\_transfer\_rules.txt](#fare_transfer_rulestxt) @@ -110,7 +110,7 @@ This specification defines the following files: | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | | [fare_rules.txt](#fare_rulestxt) | **Conditionally Required** | Rules to apply fares for itineraries.

Conditionally Required:
- **Required** if [fare_attributes.txt](#fare_attributestxt) is defined.
- **Forbidden** otherwise. | -| [fare_payment_types.txt](#fare_payment_typestxt) | Optional |To describe fare payment types associated with fare products.

File [fare_payment_types.txt](fare_payment_typestxt) describes fare payment types that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_types.txt](#fare_payment_typestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | +| [fare_payment_options.txt](#fare_payment_optionstxt) | Optional |To describe fare payment types associated with fare products.

File [fare_payment_options.txt](fare_payment_optionstxt) describes fare payment types that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_options.txt](#fare_payment_optionstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | @@ -309,7 +309,7 @@ File: **Optional** Primary key (`fare_id`) **Versions**
-There are two modelling options for describing fares. GTFS-Fares V1 is the legacy option for describing minimal fare information. GTFS-Fares V2 is an updated method that allows for a more detailed account of an agency's fare structure. Both are allowed to be present in a dataset, but only one method should be used by a data consumer for a given dataset. It is recommended that GTFS-Fares V2 takes precedence over GTFS-Fares V1.

The files associated with GTFS-Fares V1 are:
- [fare_attributes.txt](#fare_attributestxt)
- [fare_rules.txt](#fare_rulestxt)

The files associated with GTFS-Fares V2 are:
- [fare_payment_types.txt](#fare_payment_typestxt)
- [fare_products.txt](#fare_productstxt)
- [fare_leg_rules.txt](#fare_leg_rulestxt)
- [fare_transfer_rules.txt](#fare_transfer_rulestxt) +There are two modelling options for describing fares. GTFS-Fares V1 is the legacy option for describing minimal fare information. GTFS-Fares V2 is an updated method that allows for a more detailed account of an agency's fare structure. Both are allowed to be present in a dataset, but only one method should be used by a data consumer for a given dataset. It is recommended that GTFS-Fares V2 takes precedence over GTFS-Fares V1.

The files associated with GTFS-Fares V1 are:
- [fare_attributes.txt](#fare_attributestxt)
- [fare_rules.txt](#fare_rulestxt)

The files associated with GTFS-Fares V2 are:
- [fare_payment_options.txt](#fare_payment_optionstxt)
- [fare_products.txt](#fare_productstxt)
- [fare_leg_rules.txt](#fare_leg_rulestxt)
- [fare_transfer_rules.txt](#fare_transfer_rulestxt)
@@ -345,25 +345,25 @@ For examples that demonstrate how to specify a fare structure with [fare_rules.t | `destination_id` | Foreign ID referencing `stops.zone_id` | Optional | Identifies a destination zone. If a fare class has multiple destination zones, create a record in [fare_rules.txt](#fare_rules.txt) for each `destination_id`.
*Example: The `origin_id` and `destination_id` fields could be used together to specify that fare class "b" is valid for travel between zones 3 and 4, and for travel between zones 3 and 5, the [fare_rules.txt](#fare_rules.txt) file would contain these records for the fare class:*
`fare_id,...,origin_id,destination_id`
`b,...,3,4`
`b,...,3,5` | | `contains_id` | Foreign ID referencing `stops.zone_id` | Optional | Identifies the zones that a rider will enter while using a given fare class. Used in some systems to calculate correct fare class.
*Example: If fare class "c" is associated with all travel on the GRT route that passes through zones 5, 6, and 7 the [fare_rules.txt](#fare_rules.txt) would contain these records:*
`fare_id,route_id,...,contains_id`
`c,GRT,...,5`
`c,GRT,...,6`
`c,GRT,...,7`
*Because all `contains_id` zones must be matched for the fare to apply, an itinerary that passes through zones 5 and 6 but not zone 7 would not have fare class "c". For more detail, see [https://code.google.com/p/googletransitdatafeed/wiki/FareExamples](https://code.google.com/p/googletransitdatafeed/wiki/FareExamples) in the GoogleTransitDataFeed project wiki.* | -### fare_payment_types.txt - -To describe fare payment types to be associated with fare products. +### fare_payment_options.txt File: **Optional** Primary Key (`*`) +To describe fare payment options to be associated with fare products. + | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | -| `fare_payment_type_group_id` | ID | **Required** | Identifies a fare payment type group. | -| `fare_payment_type_name` | Text | Optional | Name of the fare payment type.
For payment types that are transit cards (`fare_payment_type` =2) or mobile apps (`fare_payment_type` =3), the `fare_payment_type_name` should be included and should match the rider-facing names used by the organizations delivering them. | -| `fare_payment_type` | Enum | **Required** | The type of fare payment as displayed to riders.
Valid options are:

`0` - Cash (notes and coins).
`1` - Contactless payment via bank cards (physical or virtual).
`2` - Transit card used to store fare value (physical or virtual).
`3` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip.| +| `fare_payment_option_group_id` | ID | **Required** | Identifies a fare payment option group. | +| `fare_payment_option_name` | Text | Optional | Name of the fare payment option.
For payment options that are transit cards (`fare_payment_option =2`) or mobile apps (`fare_payment_option =3`), the `fare_payment_options_name` should be included and should match the rider-facing names used by the organizations delivering them. | +| `fare_payment_option_type` | Enum | **Required** | The type of fare payment option as displayed to riders. This field represents the support that can be used directly to pay for the trip with no additional step.
Valid options are:

`0` - Cash (notes and coins).
`1` - Contactless payment via bank cards (physical or virtual).
`2` - Transit card used to store fare value (physical or virtual).
`3` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip.| ### fare_products.txt File: **Optional** -Primary Key (`fare_product_id`, `fare_payment_type_group_id`) +Primary Key (`fare_product_id`, `fare_payment_options_group_id`) To describe the different types of tickets or fares that can be purchased by riders. @@ -373,7 +373,7 @@ To describe the different types of tickets or fares that can be purchased by rid | `fare_product_name` | Text | Optional | The name of the fare product as displayed to riders. | | `amount` | Currency amount | **Required** | The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free.| | `currency` | Currency code | **Required** | The currency of the cost of the fare product. | -| `fare_payment_type_group_id` | Foreign ID referencing `fare_payment_types.fare_payment_type_group_id` | Optional | Identifies the fare payment types that can be used to pay for the `fare_product` for the trip. | +| `fare_payment_option_group_id` | Foreign ID referencing `fare_payment_options.fare_payment_option_group_id` | Optional | Identifies the fare payment types that can be used to pay for the `fare_product` for the trip. | ### fare_leg_rules.txt From e22b45881b8e5b317e223cf6474c5dfbd8a4e5d7 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 19 Dec 2022 20:55:53 -0500 Subject: [PATCH 15/38] Update reference.md --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index cdaf4b7b2..2a7e3d684 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -110,7 +110,7 @@ This specification defines the following files: | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | | [fare_rules.txt](#fare_rulestxt) | **Conditionally Required** | Rules to apply fares for itineraries.

Conditionally Required:
- **Required** if [fare_attributes.txt](#fare_attributestxt) is defined.
- **Forbidden** otherwise. | -| [fare_payment_options.txt](#fare_payment_optionstxt) | Optional |To describe fare payment types associated with fare products.

File [fare_payment_options.txt](fare_payment_optionstxt) describes fare payment types that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_options.txt](#fare_payment_optionstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | +| [fare_payment_options.txt](#fare_payment_optionstxt) | Optional |To describe fare payment options associated with fare products.

File [fare_payment_options.txt](fare_payment_optionstxt) describes fare payment types that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_options.txt](#fare_payment_optionstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | From ce6a42b959b9af72090ef22a5974cbf79fa1d486 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 19 Dec 2022 21:04:49 -0500 Subject: [PATCH 16/38] small fix --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 2a7e3d684..2c08231bf 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -110,7 +110,7 @@ This specification defines the following files: | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | | [fare_rules.txt](#fare_rulestxt) | **Conditionally Required** | Rules to apply fares for itineraries.

Conditionally Required:
- **Required** if [fare_attributes.txt](#fare_attributestxt) is defined.
- **Forbidden** otherwise. | -| [fare_payment_options.txt](#fare_payment_optionstxt) | Optional |To describe fare payment options associated with fare products.

File [fare_payment_options.txt](fare_payment_optionstxt) describes fare payment types that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_options.txt](#fare_payment_optionstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | +| [fare_payment_options.txt](#fare_payment_optionstxt) | Optional |To describe fare payment options associated with fare products.

File [fare_payment_options.txt](fare_payment_optionstxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_options.txt](#fare_payment_optionstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | From a47d32528e9f4d8ae1ad45ec26f5c254f063db05 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 19 Dec 2022 21:07:09 -0500 Subject: [PATCH 17/38] small fix --- gtfs/spec/en/reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 2c08231bf..69e0351e2 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -363,7 +363,7 @@ To describe fare payment options to be associated with fare products. File: **Optional** -Primary Key (`fare_product_id`, `fare_payment_options_group_id`) +Primary Key (`fare_product_id`, `fare_payment_option_group_id`) To describe the different types of tickets or fares that can be purchased by riders. @@ -373,7 +373,7 @@ To describe the different types of tickets or fares that can be purchased by rid | `fare_product_name` | Text | Optional | The name of the fare product as displayed to riders. | | `amount` | Currency amount | **Required** | The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free.| | `currency` | Currency code | **Required** | The currency of the cost of the fare product. | -| `fare_payment_option_group_id` | Foreign ID referencing `fare_payment_options.fare_payment_option_group_id` | Optional | Identifies the fare payment types that can be used to pay for the `fare_product` for the trip. | +| `fare_payment_option_group_id` | Foreign ID referencing `fare_payment_options.fare_payment_option_group_id` | Optional | Identifies the fare payment options that can be used to pay for the `fare_product` for the trip. | ### fare_leg_rules.txt From 4ed5631c568e0965d8f157f9e467fc772173a5ef Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 17 Jan 2023 16:02:09 -0500 Subject: [PATCH 18/38] update fare_payment_option_name description --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 69e0351e2..686fbce5b 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -356,7 +356,7 @@ To describe fare payment options to be associated with fare products. | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_payment_option_group_id` | ID | **Required** | Identifies a fare payment option group. | -| `fare_payment_option_name` | Text | Optional | Name of the fare payment option.
For payment options that are transit cards (`fare_payment_option =2`) or mobile apps (`fare_payment_option =3`), the `fare_payment_options_name` should be included and should match the rider-facing names used by the organizations delivering them. | +| `fare_payment_option_name` | Text | Optional | Name of the fare payment option to be displayed to riders.
For payment options that are transit cards (`fare_payment_option =2`) or mobile apps (`fare_payment_option =3`), the `fare_payment_options_name` should be included and should match the rider-facing names used by the organizations delivering them. | | `fare_payment_option_type` | Enum | **Required** | The type of fare payment option as displayed to riders. This field represents the support that can be used directly to pay for the trip with no additional step.
Valid options are:

`0` - Cash (notes and coins).
`1` - Contactless payment via bank cards (physical or virtual).
`2` - Transit card used to store fare value (physical or virtual).
`3` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip.| ### fare_products.txt From 0ea63c018e4f1f978bd287b8613d48a2fcbedb66 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Fri, 20 Jan 2023 18:11:12 -0500 Subject: [PATCH 19/38] Update description of fare_payment_options.txt --- gtfs/spec/en/reference.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 686fbce5b..280c9ea85 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -353,6 +353,12 @@ Primary Key (`*`) To describe fare payment options to be associated with fare products. +Fare payment options should be grouped under the same `fare_payment_option_group_id` when both the following statements are true: +- The cost of all fare products (`fare_products.amount`) is not affected by the fare payment options chosen. +- The same leg and transfer rules (as defined in `fare_leg_rules.txt` and `fare_transfer_rules.txt`) apply. + +The file `fare_payment_options.txt` shouldn't contain records that have the same values for `fare_product_option_name` and `fare_product_option_type`. + | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_payment_option_group_id` | ID | **Required** | Identifies a fare payment option group. | From 9dad0050fbaf9cf1377e48fc350775ac81510f73 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Wed, 25 Jan 2023 22:18:58 -0500 Subject: [PATCH 20/38] Update with fare_payment_option_groups.txt design --- gtfs/spec/en/reference.md | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 280c9ea85..b271d3656 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -19,7 +19,8 @@ This document defines the format and structure of the files that comprise a GTFS - [calendar\_dates.txt](#calendar_datestxt) - [fare\_attributes.txt](#fare_attributestxt) - [fare\_rules.txt](#fare_rulestxt) - - [fare\_payment_options.txt](#fare_payment_optionstxt) + - [fare\_payment\_options.txt](#fare_payment_optionstxt) + - [fare\_payment\_option\_groups.txt](#fare_payment_option_groupstxt) - [fare\_products.txt](#fare_productstxt) - [fare\_leg\_rules.txt](#fare_leg_rulestxt) - [fare\_transfer\_rules.txt](#fare_transfer_rulestxt) @@ -111,6 +112,7 @@ This specification defines the following files: | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | | [fare_rules.txt](#fare_rulestxt) | **Conditionally Required** | Rules to apply fares for itineraries.

Conditionally Required:
- **Required** if [fare_attributes.txt](#fare_attributestxt) is defined.
- **Forbidden** otherwise. | | [fare_payment_options.txt](#fare_payment_optionstxt) | Optional |To describe fare payment options associated with fare products.

File [fare_payment_options.txt](fare_payment_optionstxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_options.txt](#fare_payment_optionstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | +| [fare_payment_option_groups.txt](#fare_payment_option_groupstxt) | Optional |to model groups of fare payment options that can each be associated with the same fare product.

File [fare_payment_option_groups.txt](fare_payment_option_groupstxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_option_groups.txt](#fare_payment_option_groupstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | @@ -349,37 +351,49 @@ For examples that demonstrate how to specify a fare structure with [fare_rules.t File: **Optional** -Primary Key (`*`) +Primary Key (`fare_payment_option_id`) + +To describe fare payment options associated with fare products. + +| Field Name | Type | Presence | Description | +| ------ | ------ | ------ | ------ | +| `fare_payment_option_id` | ID | **Required** | Identifies a fare payment option. | +| `fare_payment_option_name` | Text | Optional | Name of the fare payment option to be displayed to riders.
For payment options that are transit cards (`fare_payment_option =2`) or mobile apps (`fare_payment_option =3`), the `fare_payment_options_name` should be included and should match the rider-facing names used by the organizations delivering them. | +| `fare_payment_option_type` | Enum | **Required** | The type of fare payment option as displayed to riders. This field represents the support that can be used directly to pay for the trip with no additional step.
Valid options are:

`0` - Cash (notes and coins).
`1` - Non-contactless payment via bank cards (physical only)
`2` - Contactless payment via bank cards (physical or virtual).
`3` - Transit card used to store fare value (physical or virtual).
`4` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip.| -To describe fare payment options to be associated with fare products. +### fare_payment_option_groups.txt -Fare payment options should be grouped under the same `fare_payment_option_group_id` when both the following statements are true: -- The cost of all fare products (`fare_products.amount`) is not affected by the fare payment options chosen. -- The same leg and transfer rules (as defined in `fare_leg_rules.txt` and `fare_transfer_rules.txt`) apply. +Provides a mechanism to model groups of fare payment options that can each be associated with the same fare product. -The file `fare_payment_options.txt` shouldn't contain records that have the same values for `fare_product_option_name` and `fare_product_option_type`. +File: **Optional** + +Primary Key (`*`) | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_payment_option_group_id` | ID | **Required** | Identifies a fare payment option group. | -| `fare_payment_option_name` | Text | Optional | Name of the fare payment option to be displayed to riders.
For payment options that are transit cards (`fare_payment_option =2`) or mobile apps (`fare_payment_option =3`), the `fare_payment_options_name` should be included and should match the rider-facing names used by the organizations delivering them. | -| `fare_payment_option_type` | Enum | **Required** | The type of fare payment option as displayed to riders. This field represents the support that can be used directly to pay for the trip with no additional step.
Valid options are:

`0` - Cash (notes and coins).
`1` - Contactless payment via bank cards (physical or virtual).
`2` - Transit card used to store fare value (physical or virtual).
`3` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip.| +| `fare_payment_option_id` | Foreign ID referencing `fare_payment_options.fare_payment_option_id` | **Required** | Fare payment option for the specified fare payment option group. | ### fare_products.txt File: **Optional** -Primary Key (`fare_product_id`, `fare_payment_option_group_id`) +Primary Key (`fare_product_id`, `fare_payment`option_id`, `fare_payment_option_group_id`) To describe the different types of tickets or fares that can be purchased by riders. +Though a particular fare product (as identified by its `fare_product_id`) can be associated with multiple fare payment options via repeated entries with different combinations of `fare_payment_option_group_id` and `fare_payment_option_id`, a single fare payment option must not be linked to the same fare product more than once. + +When both `fare_payment_option_group_id` and `fare_payment_option_id` are empty, it is considered that the fare payment option is unknown. + | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_product_id` | ID | **Required** | Identifies a fare product. | | `fare_product_name` | Text | Optional | The name of the fare product as displayed to riders. | +| `fare_payment_option_id` | Foreign ID referencing `fare_payment_options.fare_payment_option_id` | **Conditionally Forbidden** | Identifies the fare payment option that can be used to pay for the fare product during the trip.

Conditionally Forbidden:
- **Forbidden** if `fare_payment_option_group_id` is defined.
- Optional otherwise.| +| `fare_payment_option_group_id` | Foreign ID referencing `fare_payment_option_groups.fare_payment_option_group_id` | **Conditionally Forbidden** | Identifies a fare payment option group containing a set of fare payment options that can each be independently used to pay for the fare product during the trip.

Conditionally Forbidden:
- **Forbidden** if `fare_payment_option_id` is defined.
- Optional otherwise. | | `amount` | Currency amount | **Required** | The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free.| | `currency` | Currency code | **Required** | The currency of the cost of the fare product. | -| `fare_payment_option_group_id` | Foreign ID referencing `fare_payment_options.fare_payment_option_group_id` | Optional | Identifies the fare payment options that can be used to pay for the `fare_product` for the trip. | ### fare_leg_rules.txt From 7e259fad8bcf1ba15f71850b876f3d347da2fa58 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 14 Feb 2023 14:58:45 -0500 Subject: [PATCH 21/38] Update proposal - renamed to fare media - removed the fare_medium_groups.txt file --- gtfs/spec/en/reference.md | 40 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index b271d3656..a1216b4e4 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -19,8 +19,7 @@ This document defines the format and structure of the files that comprise a GTFS - [calendar\_dates.txt](#calendar_datestxt) - [fare\_attributes.txt](#fare_attributestxt) - [fare\_rules.txt](#fare_rulestxt) - - [fare\_payment\_options.txt](#fare_payment_optionstxt) - - [fare\_payment\_option\_groups.txt](#fare_payment_option_groupstxt) + - [fare\_media.txt](#fare_media.txt) - [fare\_products.txt](#fare_productstxt) - [fare\_leg\_rules.txt](#fare_leg_rulestxt) - [fare\_transfer\_rules.txt](#fare_transfer_rulestxt) @@ -111,8 +110,7 @@ This specification defines the following files: | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | | [fare_rules.txt](#fare_rulestxt) | **Conditionally Required** | Rules to apply fares for itineraries.

Conditionally Required:
- **Required** if [fare_attributes.txt](#fare_attributestxt) is defined.
- **Forbidden** otherwise. | -| [fare_payment_options.txt](#fare_payment_optionstxt) | Optional |To describe fare payment options associated with fare products.

File [fare_payment_options.txt](fare_payment_optionstxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_options.txt](#fare_payment_optionstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | -| [fare_payment_option_groups.txt](#fare_payment_option_groupstxt) | Optional |to model groups of fare payment options that can each be associated with the same fare product.

File [fare_payment_option_groups.txt](fare_payment_option_groupstxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_payment_option_groups.txt](#fare_payment_option_groupstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | +| [fare_media.txt](#fare_mediatxt) | Optional |To describe fare media associated with fare products.

File [fare_media.txt](fare_mediatxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_media.txt](#fare_mediatxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | @@ -347,51 +345,33 @@ For examples that demonstrate how to specify a fare structure with [fare_rules.t | `destination_id` | Foreign ID referencing `stops.zone_id` | Optional | Identifies a destination zone. If a fare class has multiple destination zones, create a record in [fare_rules.txt](#fare_rules.txt) for each `destination_id`.
*Example: The `origin_id` and `destination_id` fields could be used together to specify that fare class "b" is valid for travel between zones 3 and 4, and for travel between zones 3 and 5, the [fare_rules.txt](#fare_rules.txt) file would contain these records for the fare class:*
`fare_id,...,origin_id,destination_id`
`b,...,3,4`
`b,...,3,5` | | `contains_id` | Foreign ID referencing `stops.zone_id` | Optional | Identifies the zones that a rider will enter while using a given fare class. Used in some systems to calculate correct fare class.
*Example: If fare class "c" is associated with all travel on the GRT route that passes through zones 5, 6, and 7 the [fare_rules.txt](#fare_rules.txt) would contain these records:*
`fare_id,route_id,...,contains_id`
`c,GRT,...,5`
`c,GRT,...,6`
`c,GRT,...,7`
*Because all `contains_id` zones must be matched for the fare to apply, an itinerary that passes through zones 5 and 6 but not zone 7 would not have fare class "c". For more detail, see [https://code.google.com/p/googletransitdatafeed/wiki/FareExamples](https://code.google.com/p/googletransitdatafeed/wiki/FareExamples) in the GoogleTransitDataFeed project wiki.* | -### fare_payment_options.txt +### fare_media.txt File: **Optional** -Primary Key (`fare_payment_option_id`) +Primary Key (`fare_medium_id`) -To describe fare payment options associated with fare products. +To describe the different fare media that can be employed to use fare products. Fare media are physical or virtual containers used for the representation and/or validation of a fare product. | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | -| `fare_payment_option_id` | ID | **Required** | Identifies a fare payment option. | -| `fare_payment_option_name` | Text | Optional | Name of the fare payment option to be displayed to riders.
For payment options that are transit cards (`fare_payment_option =2`) or mobile apps (`fare_payment_option =3`), the `fare_payment_options_name` should be included and should match the rider-facing names used by the organizations delivering them. | -| `fare_payment_option_type` | Enum | **Required** | The type of fare payment option as displayed to riders. This field represents the support that can be used directly to pay for the trip with no additional step.
Valid options are:

`0` - Cash (notes and coins).
`1` - Non-contactless payment via bank cards (physical only)
`2` - Contactless payment via bank cards (physical or virtual).
`3` - Transit card used to store fare value (physical or virtual).
`4` - Mobile app used to store fare tickets & passes. Mobile apps are not tied to a particular transit card, and they can be used directly for the trip.| - -### fare_payment_option_groups.txt - -Provides a mechanism to model groups of fare payment options that can each be associated with the same fare product. - -File: **Optional** - -Primary Key (`*`) - -| Field Name | Type | Presence | Description | -| ------ | ------ | ------ | ------ | -| `fare_payment_option_group_id` | ID | **Required** | Identifies a fare payment option group. | -| `fare_payment_option_id` | Foreign ID referencing `fare_payment_options.fare_payment_option_id` | **Required** | Fare payment option for the specified fare payment option group. | +| `fare_medium_id` | ID | **Required** | Identifies a fare medium. | +| `fare_medium_name` | Text | Optional | Name of the fare medium to be displayed to riders.
For fare media which are transit cards (`fare_media_type =2`) or mobile apps (`fare_media_type =4`), the `fare_media_name` should be included and should match the rider-facing names used by the organizations delivering them. | +| `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` or empty - None.
`1` - Physical paper ticket that allows a passenger to take either a certain number of pre-purchased trips or unlimited trips within a fixed period of time.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEVM as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt File: **Optional** -Primary Key (`fare_product_id`, `fare_payment`option_id`, `fare_payment_option_group_id`) +Primary Key (`fare_product_id`, `fare_medium_id`) To describe the different types of tickets or fares that can be purchased by riders. -Though a particular fare product (as identified by its `fare_product_id`) can be associated with multiple fare payment options via repeated entries with different combinations of `fare_payment_option_group_id` and `fare_payment_option_id`, a single fare payment option must not be linked to the same fare product more than once. - -When both `fare_payment_option_group_id` and `fare_payment_option_id` are empty, it is considered that the fare payment option is unknown. - | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_product_id` | ID | **Required** | Identifies a fare product. | | `fare_product_name` | Text | Optional | The name of the fare product as displayed to riders. | -| `fare_payment_option_id` | Foreign ID referencing `fare_payment_options.fare_payment_option_id` | **Conditionally Forbidden** | Identifies the fare payment option that can be used to pay for the fare product during the trip.

Conditionally Forbidden:
- **Forbidden** if `fare_payment_option_group_id` is defined.
- Optional otherwise.| -| `fare_payment_option_group_id` | Foreign ID referencing `fare_payment_option_groups.fare_payment_option_group_id` | **Conditionally Forbidden** | Identifies a fare payment option group containing a set of fare payment options that can each be independently used to pay for the fare product during the trip.

Conditionally Forbidden:
- **Forbidden** if `fare_payment_option_id` is defined.
- Optional otherwise. | +| `fare_medium_id` | Foreign ID referencing `fare_media.fare_medium_id` | Optional | Identifies a fare medium that can be employed used to use the `fare product` during the trip. When `fare_medium_id`is empty, it is considered that the fare media is unknown.| | `amount` | Currency amount | **Required** | The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free.| | `currency` | Currency code | **Required** | The currency of the cost of the fare product. | From c8f2d24a91b6c85aeb22c31ee3eb83a62c8e5681 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 14 Feb 2023 15:00:08 -0500 Subject: [PATCH 22/38] typo --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index a1216b4e4..9f6fa7352 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -19,7 +19,7 @@ This document defines the format and structure of the files that comprise a GTFS - [calendar\_dates.txt](#calendar_datestxt) - [fare\_attributes.txt](#fare_attributestxt) - [fare\_rules.txt](#fare_rulestxt) - - [fare\_media.txt](#fare_media.txt) + - [fare\_media.txt](#fare_mediatxt) - [fare\_products.txt](#fare_productstxt) - [fare\_leg\_rules.txt](#fare_leg_rulestxt) - [fare\_transfer\_rules.txt](#fare_transfer_rulestxt) From 18ec06f6881dad5979a08b00a2f70cb1a5fdac5d Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 14 Feb 2023 15:01:03 -0500 Subject: [PATCH 23/38] Update reference.md --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 9f6fa7352..c54e9b423 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -110,7 +110,7 @@ This specification defines the following files: | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | | [fare_rules.txt](#fare_rulestxt) | **Conditionally Required** | Rules to apply fares for itineraries.

Conditionally Required:
- **Required** if [fare_attributes.txt](#fare_attributestxt) is defined.
- **Forbidden** otherwise. | -| [fare_media.txt](#fare_mediatxt) | Optional |To describe fare media associated with fare products.

File [fare_media.txt](fare_mediatxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_media.txt](#fare_mediatxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | +| [fare_media.txt](#fare_mediatxt) | Optional | To describe the fare media that can be employed to use fare products.

File [fare_media.txt](fare_mediatxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_media.txt](#fare_mediatxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | From 6b2110fbec3adedd03410cfd11252ed1adbbbe75 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 14 Feb 2023 15:02:45 -0500 Subject: [PATCH 24/38] update description of fare medium name --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index c54e9b423..43a8c3b18 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -356,7 +356,7 @@ To describe the different fare media that can be employed to use fare products. | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_medium_id` | ID | **Required** | Identifies a fare medium. | -| `fare_medium_name` | Text | Optional | Name of the fare medium to be displayed to riders.
For fare media which are transit cards (`fare_media_type =2`) or mobile apps (`fare_media_type =4`), the `fare_media_name` should be included and should match the rider-facing names used by the organizations delivering them. | +| `fare_medium_name` | Text | Optional | Name of the fare medium.
For fare media which are transit cards (`fare_medium_type =2`) or mobile apps (`fare_medium_type =4`), the `fare_medium_name` should be included and should match the rider-facing name used by the organizations delivering them. | | `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` or empty - None.
`1` - Physical paper ticket that allows a passenger to take either a certain number of pre-purchased trips or unlimited trips within a fixed period of time.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEVM as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt From ee6cb962a97205c4c96b9a0ee7a483bff484b557 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 14 Feb 2023 20:19:47 -0500 Subject: [PATCH 25/38] small fix --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 43a8c3b18..3d604dfad 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -351,7 +351,7 @@ File: **Optional** Primary Key (`fare_medium_id`) -To describe the different fare media that can be employed to use fare products. Fare media are physical or virtual containers used for the representation and/or validation of a fare product. +To describe the different fare media that can be employed to use fare products. Fare media are physical or virtual holders used for the representation and/or validation of a fare product. | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | From 37293b345dfe53f43e2dcef982d035cce14092ac Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Fri, 17 Feb 2023 09:02:36 -0500 Subject: [PATCH 26/38] Change fare media from "ID" to "Unique ID" --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 3d604dfad..e8132e0fb 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -355,7 +355,7 @@ To describe the different fare media that can be employed to use fare products. | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | -| `fare_medium_id` | ID | **Required** | Identifies a fare medium. | +| `fare_medium_id` | Unique ID | **Required** | Identifies a fare medium. | | `fare_medium_name` | Text | Optional | Name of the fare medium.
For fare media which are transit cards (`fare_medium_type =2`) or mobile apps (`fare_medium_type =4`), the `fare_medium_name` should be included and should match the rider-facing name used by the organizations delivering them. | | `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` or empty - None.
`1` - Physical paper ticket that allows a passenger to take either a certain number of pre-purchased trips or unlimited trips within a fixed period of time.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEVM as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| From 68c98db0ffbbbad45a605f17b26de2eee0af597b Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Fri, 17 Feb 2023 11:57:38 -0500 Subject: [PATCH 27/38] Remove "or empty" in fare_media_type because --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index e8132e0fb..94b0e82de 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,7 +357,7 @@ To describe the different fare media that can be employed to use fare products. | ------ | ------ | ------ | ------ | | `fare_medium_id` | Unique ID | **Required** | Identifies a fare medium. | | `fare_medium_name` | Text | Optional | Name of the fare medium.
For fare media which are transit cards (`fare_medium_type =2`) or mobile apps (`fare_medium_type =4`), the `fare_medium_name` should be included and should match the rider-facing name used by the organizations delivering them. | -| `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` or empty - None.
`1` - Physical paper ticket that allows a passenger to take either a certain number of pre-purchased trips or unlimited trips within a fixed period of time.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEVM as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| +| `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` - None.
`1` - Physical paper ticket that allows a passenger to take either a certain number of pre-purchased trips or unlimited trips within a fixed period of time.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEVM as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt From 83d6e06d24e24ee90ca52e3b60113f329af1ebba Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 21 Feb 2023 16:08:35 -0500 Subject: [PATCH 28/38] fix typo and add cEMV acronym --- gtfs/spec/en/reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 94b0e82de..52f1f7ff0 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -105,7 +105,7 @@ This specification defines the following files: | [stops.txt](#stopstxt) | **Required** | Stops where vehicles pick up or drop off riders. Also defines stations and station entrances. | | [routes.txt](#routestxt) | **Required** | Transit routes. A route is a group of trips that are displayed to riders as a single service. | | [trips.txt](#tripstxt) | **Required** | Trips for each route. A trip is a sequence of two or more stops that occur during a specific time period. | -| [stop_times.txt](#stop_timestxt) | **Required** | Times that a vehicle arrives at and departs from stops for each trip. | +| [stop_times.txt](#stop_timestxt)| **Required** | Times that a vehicle arrives at and departs from stops for each trip. | | [calendar.txt](#calendartxt) | **Conditionally Required** | Service dates specified using a weekly schedule with start and end dates.

Conditionally Required:
- **Required** unless all dates of service are defined in [calendar_dates.txt](#calendar_datestxt).
- Optional otherwise. | | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | @@ -357,7 +357,7 @@ To describe the different fare media that can be employed to use fare products. | ------ | ------ | ------ | ------ | | `fare_medium_id` | Unique ID | **Required** | Identifies a fare medium. | | `fare_medium_name` | Text | Optional | Name of the fare medium.
For fare media which are transit cards (`fare_medium_type =2`) or mobile apps (`fare_medium_type =4`), the `fare_medium_name` should be included and should match the rider-facing name used by the organizations delivering them. | -| `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` - None.
`1` - Physical paper ticket that allows a passenger to take either a certain number of pre-purchased trips or unlimited trips within a fixed period of time.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEVM as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| +| `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` - None.
`1` - Physical paper ticket that allows a passenger to take either a certain number of pre-purchased trips or unlimited trips within a fixed period of time.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt From f1278039b77f008bd50205e5e05fc5214f0e41e3 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 28 Feb 2023 10:20:30 -0500 Subject: [PATCH 29/38] remove paper ticket (not produced) --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 52f1f7ff0..f22325d6e 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,7 +357,7 @@ To describe the different fare media that can be employed to use fare products. | ------ | ------ | ------ | ------ | | `fare_medium_id` | Unique ID | **Required** | Identifies a fare medium. | | `fare_medium_name` | Text | Optional | Name of the fare medium.
For fare media which are transit cards (`fare_medium_type =2`) or mobile apps (`fare_medium_type =4`), the `fare_medium_name` should be included and should match the rider-facing name used by the organizations delivering them. | -| `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` - None.
`1` - Physical paper ticket that allows a passenger to take either a certain number of pre-purchased trips or unlimited trips within a fixed period of time.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| +| `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` - None.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt From 7327c2f05af7b1116e8d095e2c3e10b062a82db4 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 6 Mar 2023 08:16:29 -0500 Subject: [PATCH 30/38] Fix typos - "used to use" in fare media description - reference to fare_payment_options that wasn't removed - replace "have"with "has" in fare_media_type 2 description --- gtfs/spec/en/reference.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index f22325d6e..f62795ace 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -309,7 +309,7 @@ File: **Optional** Primary key (`fare_id`) **Versions**
-There are two modelling options for describing fares. GTFS-Fares V1 is the legacy option for describing minimal fare information. GTFS-Fares V2 is an updated method that allows for a more detailed account of an agency's fare structure. Both are allowed to be present in a dataset, but only one method should be used by a data consumer for a given dataset. It is recommended that GTFS-Fares V2 takes precedence over GTFS-Fares V1.

The files associated with GTFS-Fares V1 are:
- [fare_attributes.txt](#fare_attributestxt)
- [fare_rules.txt](#fare_rulestxt)

The files associated with GTFS-Fares V2 are:
- [fare_payment_options.txt](#fare_payment_optionstxt)
- [fare_products.txt](#fare_productstxt)
- [fare_leg_rules.txt](#fare_leg_rulestxt)
- [fare_transfer_rules.txt](#fare_transfer_rulestxt) +There are two modelling options for describing fares. GTFS-Fares V1 is the legacy option for describing minimal fare information. GTFS-Fares V2 is an updated method that allows for a more detailed account of an agency's fare structure. Both are allowed to be present in a dataset, but only one method should be used by a data consumer for a given dataset. It is recommended that GTFS-Fares V2 takes precedence over GTFS-Fares V1.

The files associated with GTFS-Fares V1 are:
- [fare_attributes.txt](#fare_attributestxt)
- [fare_rules.txt](#fare_rulestxt)

The files associated with GTFS-Fares V2 are:
- [fare_media.txt](#fare_mediatxt)
- [fare_products.txt](#fare_productstxt)
- [fare_leg_rules.txt](#fare_leg_rulestxt)
- [fare_transfer_rules.txt](#fare_transfer_rulestxt)
@@ -349,21 +349,21 @@ For examples that demonstrate how to specify a fare structure with [fare_rules.t File: **Optional** -Primary Key (`fare_medium_id`) +Primary Key (`fare_media_id`) To describe the different fare media that can be employed to use fare products. Fare media are physical or virtual holders used for the representation and/or validation of a fare product. | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | -| `fare_medium_id` | Unique ID | **Required** | Identifies a fare medium. | -| `fare_medium_name` | Text | Optional | Name of the fare medium.
For fare media which are transit cards (`fare_medium_type =2`) or mobile apps (`fare_medium_type =4`), the `fare_medium_name` should be included and should match the rider-facing name used by the organizations delivering them. | -| `fare_medium_type` | Enum | **Required** | The type of fare medium.
Valid options are:

`0` - None.
`2` - Physical transit card that have stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| +| `fare_media_id` | Unique ID | **Required** | Identifies a fare media. | +| `fare_media_name` | Text | Optional | Name of the fare media.
For fare media which are transit cards (`fare_media_type =2`) or mobile apps (`fare_media_type =4`), the `fare_media_name` should be included and should match the rider-facing name used by the organizations delivering them. | +| `fare_media_type` | Enum | **Required** | The type of fare media.
Valid options are:

`0` - None.
`2` - Physical transit card that has stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt File: **Optional** -Primary Key (`fare_product_id`, `fare_medium_id`) +Primary Key (`fare_product_id`, `fare_media_id`) To describe the different types of tickets or fares that can be purchased by riders. @@ -371,7 +371,7 @@ To describe the different types of tickets or fares that can be purchased by rid | ------ | ------ | ------ | ------ | | `fare_product_id` | ID | **Required** | Identifies a fare product. | | `fare_product_name` | Text | Optional | The name of the fare product as displayed to riders. | -| `fare_medium_id` | Foreign ID referencing `fare_media.fare_medium_id` | Optional | Identifies a fare medium that can be employed used to use the `fare product` during the trip. When `fare_medium_id`is empty, it is considered that the fare media is unknown.| +| `fare_media_id` | Foreign ID referencing `fare_media.fare_media_id` | Optional | Identifies a fare media that can be employed to use the `fare product` during the trip. When `fare_media_id`is empty, it is considered that the fare media is unknown.| | `amount` | Currency amount | **Required** | The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free.| | `currency` | Currency code | **Required** | The currency of the cost of the fare product. | From 9840f03b70c22da422be951698e80e3ce9258657 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 6 Mar 2023 10:32:56 -0500 Subject: [PATCH 31/38] Update fare media definition --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index f62795ace..297983cb4 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,7 +357,7 @@ To describe the different fare media that can be employed to use fare products. | ------ | ------ | ------ | ------ | | `fare_media_id` | Unique ID | **Required** | Identifies a fare media. | | `fare_media_name` | Text | Optional | Name of the fare media.
For fare media which are transit cards (`fare_media_type =2`) or mobile apps (`fare_media_type =4`), the `fare_media_name` should be included and should match the rider-facing name used by the organizations delivering them. | -| `fare_media_type` | Enum | **Required** | The type of fare media.
Valid options are:

`0` - None.
`2` - Physical transit card that has stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| +| `fare_media_type` | Enum | **Required** | The type of fare media.
Valid options are:

`0` - None. Used for when there is no fare media involved in purchasing or validating a fare product, such as paying cash to a driver or conductor with no physical ticket provided.
`2` - Physical transit card that has stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt From e31ac5f32b9974f1854f89347c6ece0366141fa3 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 6 Mar 2023 10:38:02 -0500 Subject: [PATCH 32/38] solve merge conflicts --- gtfs/spec/en/reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index fa2bbc12f..86ce8b1d1 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -105,11 +105,11 @@ This specification defines the following files: | [stops.txt](#stopstxt) | **Required** | Stops where vehicles pick up or drop off riders. Also defines stations and station entrances. | | [routes.txt](#routestxt) | **Required** | Transit routes. A route is a group of trips that are displayed to riders as a single service. | | [trips.txt](#tripstxt) | **Required** | Trips for each route. A trip is a sequence of two or more stops that occur during a specific time period. | -| [stop_times.txt](#stop_timestxt)| **Required** | Times that a vehicle arrives at and departs from stops for each trip. | +| [stop_times.txt](#stop_timestxt) | **Required** | Times that a vehicle arrives at and departs from stops for each trip. | | [calendar.txt](#calendartxt) | **Conditionally Required** | Service dates specified using a weekly schedule with start and end dates.

Conditionally Required:
- **Required** unless all dates of service are defined in [calendar_dates.txt](#calendar_datestxt).
- Optional otherwise. | | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | -| [fare_rules.txt](#fare_rulestxt) | Optional | Rules to apply fares for itineraries.

Conditionally Required:
- **Required** if [fare_attributes.txt](#fare_attributestxt) is defined.
- **Forbidden** otherwise. | +| [fare_rules.txt](#fare_rulestxt) | Optional | Rules to apply fares for itineraries. | | [fare_media.txt](#fare_mediatxt) | Optional | To describe the fare media that can be employed to use fare products.

File [fare_media.txt](fare_mediatxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_media.txt](#fare_mediatxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | From 8ae6f601cca3274132e33ae3d0dfb21a0757f216 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 6 Mar 2023 10:39:56 -0500 Subject: [PATCH 33/38] Add line break --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 86ce8b1d1..923bdefd2 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -356,7 +356,7 @@ To describe the different fare media that can be employed to use fare products. | Field Name | Type | Presence | Description | | ------ | ------ | ------ | ------ | | `fare_media_id` | Unique ID | **Required** | Identifies a fare media. | -| `fare_media_name` | Text | Optional | Name of the fare media.
For fare media which are transit cards (`fare_media_type =2`) or mobile apps (`fare_media_type =4`), the `fare_media_name` should be included and should match the rider-facing name used by the organizations delivering them. | +| `fare_media_name` | Text | Optional | Name of the fare media.

For fare media which are transit cards (`fare_media_type =2`) or mobile apps (`fare_media_type =4`), the `fare_media_name` should be included and should match the rider-facing name used by the organizations delivering them. | | `fare_media_type` | Enum | **Required** | The type of fare media.
Valid options are:

`0` - None. Used for when there is no fare media involved in purchasing or validating a fare product, such as paying cash to a driver or conductor with no physical ticket provided.
`2` - Physical transit card that has stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt From f8008dcd4d40fdc964ca8199415d3692dce959d1 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Mon, 6 Mar 2023 10:40:57 -0500 Subject: [PATCH 34/38] remove line break --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 923bdefd2..d7c5ade8a 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,7 +357,7 @@ To describe the different fare media that can be employed to use fare products. | ------ | ------ | ------ | ------ | | `fare_media_id` | Unique ID | **Required** | Identifies a fare media. | | `fare_media_name` | Text | Optional | Name of the fare media.

For fare media which are transit cards (`fare_media_type =2`) or mobile apps (`fare_media_type =4`), the `fare_media_name` should be included and should match the rider-facing name used by the organizations delivering them. | -| `fare_media_type` | Enum | **Required** | The type of fare media.
Valid options are:

`0` - None. Used for when there is no fare media involved in purchasing or validating a fare product, such as paying cash to a driver or conductor with no physical ticket provided.
`2` - Physical transit card that has stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| +| `fare_media_type` | Enum | **Required** | The type of fare media. Valid options are:

`0` - None. Used for when there is no fare media involved in purchasing or validating a fare product, such as paying cash to a driver or conductor with no physical ticket provided.
`2` - Physical transit card that has stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt From 7f0860041c53e1465b8f5a47aa38081ec1065c20 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 14 Mar 2023 10:31:46 -0400 Subject: [PATCH 35/38] fix typo (additional "for) --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index d7c5ade8a..2d60ec9cf 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -357,7 +357,7 @@ To describe the different fare media that can be employed to use fare products. | ------ | ------ | ------ | ------ | | `fare_media_id` | Unique ID | **Required** | Identifies a fare media. | | `fare_media_name` | Text | Optional | Name of the fare media.

For fare media which are transit cards (`fare_media_type =2`) or mobile apps (`fare_media_type =4`), the `fare_media_name` should be included and should match the rider-facing name used by the organizations delivering them. | -| `fare_media_type` | Enum | **Required** | The type of fare media. Valid options are:

`0` - None. Used for when there is no fare media involved in purchasing or validating a fare product, such as paying cash to a driver or conductor with no physical ticket provided.
`2` - Physical transit card that has stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| +| `fare_media_type` | Enum | **Required** | The type of fare media. Valid options are:

`0` - None. Used when there is no fare media involved in purchasing or validating a fare product, such as paying cash to a driver or conductor with no physical ticket provided.
`2` - Physical transit card that has stored tickets, passes or monetary value.
`3` - cEMV (contactless Europay, Mastercard and Visa) as an open-loop token container for account-based ticketing.
`4` - Mobile app that have stored virtual transit cards, tickets, passes, or monetary value.| ### fare_products.txt From 05dc9a9c8590100b067dd00d6f1a48b33a4f3015 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 14 Mar 2023 10:37:48 -0400 Subject: [PATCH 36/38] Update revision history --- gtfs/CHANGES.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gtfs/CHANGES.md b/gtfs/CHANGES.md index 9bfe6121a..c537d1f38 100644 --- a/gtfs/CHANGES.md +++ b/gtfs/CHANGES.md @@ -53,21 +53,25 @@ Every new feature adds complexity to the creation and reading of feeds. Therefor ### Revision History +#### March 14, 2023 + +* Added fare media. See [discussion](https://github.com/google/transit/pull/355). + #### July 26, 2022 -* Added trip-to-trip transfers with in-seat option. See [discussion](https://github.com/google/transit/pull/303) +* Added trip-to-trip transfers with in-seat option. See [discussion](https://github.com/google/transit/pull/303). #### May 17, 2022 -* GTFS-Fares v2 base implementation. See [discussion](https://github.com/google/transit/pull/286) +* GTFS-Fares v2 base implementation. See [discussion](https://github.com/google/transit/pull/286). #### Oct 22, 2021 -* Added Primary and Foreign ID fields. See [discussion](https://github.com/google/transit/pull/278) +* Added Primary and Foreign ID fields. See [discussion](https://github.com/google/transit/pull/278). #### Oct 05, 2021 -* Added Trip-to-trip and route-to-route transfers. See [discussion](https://github.com/google/transit/pull/284) +* Added Trip-to-trip and route-to-route transfers. See [discussion](https://github.com/google/transit/pull/284). #### September 15, 2021 From cc728f7c2460c9d37b591ec55116f6670639c81f Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 14 Mar 2023 10:46:49 -0400 Subject: [PATCH 37/38] formatting fix --- gtfs/spec/en/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 2d60ec9cf..4e392e0e7 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -371,7 +371,7 @@ To describe the different types of tickets or fares that can be purchased by rid | ------ | ------ | ------ | ------ | | `fare_product_id` | ID | **Required** | Identifies a fare product. | | `fare_product_name` | Text | Optional | The name of the fare product as displayed to riders. | -| `fare_media_id` | Foreign ID referencing `fare_media.fare_media_id` | Optional | Identifies a fare media that can be employed to use the `fare product` during the trip. When `fare_media_id`is empty, it is considered that the fare media is unknown.| +| `fare_media_id` | Foreign ID referencing `fare_media.fare_media_id` | Optional | Identifies a fare media that can be employed to use the fare product during the trip. When `fare_media_id` is empty, it is considered that the fare media is unknown.| | `amount` | Currency amount | **Required** | The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free.| | `currency` | Currency code | **Required** | The currency of the cost of the fare product. | From 481e4c156b2c8e8c57758683b5b532b7436d7189 Mon Sep 17 00:00:00 2001 From: isabelle-dr Date: Tue, 14 Mar 2023 10:53:11 -0400 Subject: [PATCH 38/38] formatting issue --- gtfs/spec/en/reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtfs/spec/en/reference.md b/gtfs/spec/en/reference.md index 4e392e0e7..a917e6012 100644 --- a/gtfs/spec/en/reference.md +++ b/gtfs/spec/en/reference.md @@ -110,8 +110,8 @@ This specification defines the following files: | [calendar_dates.txt](#calendar_datestxt) | **Conditionally Required** | Exceptions for the services defined in the [calendar.txt](#calendartxt).

Conditionally Required:
- **Required** if [calendar.txt](#calendartxt) is omitted. In which case [calendar_dates.txt](#calendar_datestxt) must contain all dates of service.
- Optional otherwise. | | [fare_attributes.txt](#fare_attributestxt) | Optional | Fare information for a transit agency's routes. | | [fare_rules.txt](#fare_rulestxt) | Optional | Rules to apply fares for itineraries. | -| [fare_media.txt](#fare_mediatxt) | Optional | To describe the fare media that can be employed to use fare products.

File [fare_media.txt](fare_mediatxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_media.txt](#fare_mediatxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | -| [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | +| [fare_media.txt](#fare_mediatxt) | Optional | To describe the fare media that can be employed to use fare products.

File [fare_media.txt](#fare_mediatxt) describes concepts that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_media.txt](#fare_mediatxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | +| [fare_products.txt](#fare_productstxt) | Optional | To describe the different types of tickets or fares that can be purchased by riders.

File [fare_products.txt](#fare_productstxt) describes fare products that are not represented in [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). As such, the use of [fare_products.txt](#fare_productstxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_leg_rules.txt](#fare_leg_rulestxt) | Optional | Fare rules for individual legs of travel.

File [fare_leg_rules.txt](#fare_leg_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_leg_rules.txt](#fare_leg_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [fare_transfer_rules.txt](#fare_transfer_rulestxt) | Optional | Fare rules for transfers between legs of travel.

Along with [fare_leg_rules.txt](#fare_leg_rulestxt), file [fare_transfer_rules.txt](#fare_transfer_rulestxt) provides a more detailed method for modeling fare structures. As such, the use of [fare_transfer_rules.txt](#fare_transfer_rulestxt) is entirely separate from files [fare_attributes.txt](#fare_attributestxt) and [fare_rules.txt](#fare_rulestxt). | | [areas.txt](#areastxt) | Optional | Area grouping of locations. |