google / google/transit

Inter-agency transfer fare processing (within the same GTFS dataset)

Open
#345 3 comments 2 reactions 0 assignees View on GitHub
GTFS Schedule GTFS-Fares Status: Stale
Dominant language
No language data
Stars
1.1k
Forks
225
Avg merge
7d 17h
Merged PRs (30d)
3

Description

Hey everyone - this issue is on processing fares for transfers between different agencies. For example: riders with ticket A on agency#1 can transfer for free to agency#2. This is based on [this proposal](https://docs.google.com/document/d/18yWhwR89pQp48VuBNPXK0djLXOtdjWhgC2h6jCC8WPM/edit#heading=h.bhbxvegn4na) by Transit.

This requires adding two fields to `fare_leg_rules.txt` and `fare_transfer_rules`:
- `filter_fare_product_id`: Indicates that this rule is in effect if a fare product is being used
- `transfer_only`: Indicates that this rule is only considered if the rider transfers to this leg. This rule will not be considered if it matches the first leg of a rider's journey.

To keep this issue short, please refer to the proposal hyperlinked above for information on the files and fields in this proposal as well as an example.

It seems that `fare_leg_rules.txt` and `fare_transfer_rules.txt` cannot represent a use case where a certain leg cannot be travelled unless a previous condition has been met (in the example in the above proposal, a rider has travelled on the Goatville express).
- Without the field `fare_leg_rules.transfer_only`, it is not possible to represent the fact that riders cannot travel on the Marmottown local using their Goatville express ticket **unless** they travelled on the Goatville express.
- Without the field `fare_transfer_rules.filter_fare_product_id`, it is not possible to represent the fact that riders need to have a valid fare for the Goatville express to travel on the Marmottown local.

The only action item would be to agree on the definitions and presence of `filter_fare_product_id` and `transfer_only` as well as the Primary Keys for `fare_leg_rules.txt` and `fare_transfer_rules.txt`.

`fare_leg_rules.txt`:
`transfer_only` (enum, Optional): *changed from bool to enum from the proposal)*
- 1: This rule may only be considered if there is a matching fare transfer rule from the preceding leg to the current leg. A rule with `transfer_only=1` can never match the first leg of a journey.
- 0 or unspecified: This rule may be considered regardless of whether any transfer rules apply.

`fare_transfer_rules.txt`:
`filter_fare_product_id` (ID referencing `fare_products.fare_product_id`, Optional):
- Identifies a valid and active fare product that a rider needs to be eligible for this transfer.

`transfer_only` needs to be added to the Primary Keys for `fare_leg_rules.txt`.
`filter_fare_product_id` needs to be added to the Primary Keys for `fare_transfer_rules.txt`.

We are happy to open a pull request for this issue if we can get consensus.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.