google / google/transit

The transfer.txt specificity ranking is ambiguous

Open
#298 14 comments 1 reaction 0 assignees View on GitHub
GTFS Schedule Ready for Pull Request Status: Stale
Dominant language
No language data
Stars
1.1k
Forks
225
Avg merge
7d 17h
Merged PRs (30d)
3

Description

The specification do not distinguish between Stop and Station, I believe the Stop is more specific than a Station.

Also, in some cases the different combinations result in the same ranking. Consider these two examples:

*Case A*

1. Transfer from (Stop) to (Route, Stop)
2. Transfer from (Route, Stop) to( Stop)

*Case B*
1. Transfer from (Trip, Stop) to (Route, Stop)
2. Transfer from (Route, Stop) and (Trip, Stop)

In both these cases the specificity ranking is the same. My suggestion is to let the **From** transfer point take precedence if the ranking is the same.

When implementing this the following ranking sudo code would work:

**Ranking Transfer Point**

- 0 : Station
- 1 : Stop
- 2 : Route
- 3 : Trip

**Ranking Transfer**
`[from transfer point] x 11 + [to transfer point] x 10`

In case A, transfer 1 will have 31 `1x11 + 2x10` in ranking and transfer 2 will have 32 `2x11 + 1x10` -> Case A.2 will be used.

This problem is not limited to the case A and B above.

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.