Skip to content

"Direction names" in GTFS #228

Closed
Closed

Description

@timMillet

For the last update (2020-11-20) on the issue, please go to this comment.


Hi everyone,

I’m opening an issue regarding “direction names” (also called “directions”, “route directions”, “direction destinations”, or “direction headsigns”) as some GTFS stakeholders already provide and consume these data. Before making any specification proposal, I would appreciate having your input on:

  1. If you would like these data to be officially adopted in the GTFS specification.
  2. On how these data should be modeled.
  3. On the name you would give to these "direction names".

The needs are:

  • Providing riders with more detailed information on directions, especially for routes with complex trip patterns (e.g: routes with branches). The direction name would be a piece of information complementary to the trip_headsign and/or stop_headsign.
  • Being defined per route at the trip level, at the direction level (trips.direction_id), and/or at the stop_time level. The use cases would be:
    • trip and direction levels: defining a direction that is true for all trips going to the same direction at all their stop_times (e.g with the Red Line in Boston: direction “Southbound” for trips heading either to “Ashmont” or to “Braintree”)
    • stop_time level: defining a direction that is true for all trips going to the same direction at that particular stop_time (e.g: direction “Inbound” until the first downtown stop is reached, then “Outbound”)
  • Being compatible with all king of general directions (e.g: “South”, “Southbound”, “Inbound”, “Clockwise”, “Loop”, “Intérieur”, “Sud vers Paris”, “T-Centralen”, “Fruängen/Norsborg”).

The current implementations are (Gdoc with more details):

  • 1 new file with 3 to 4 fields: MBTA, MTC (SF Bay Area), Trillium, TriMet
  • 2 new fields in already-existing files: Transit

Thank you for all your feedback!

Activity

  1. added
    GTFS Schedule
    on Jun 17, 2020
  2. laurentg commented on Jun 22, 2020

    @laurentg

    Added a small comment in the Gdoc for Mecatran implementation and support.

    We would be generally in favor of specifying (even if non-formal) at least direction per route/direction level (two directions names per route), as many feeds do produce such information but many different standards co-exist at the moment.

  3. gcamp commented on Jun 25, 2020

    @gcamp
    Contributor

    Even if it's not our current implementation, I would suggest using the directions.txt file.

    For places that would change direction name during their trip, I would suggest using block_id to link together two splitted trips that each have their direction. Imagine for CTA's 'L' loop, the trip could be split in two in the middle of the loop to show the change of direction.

  4. stevenmwhite commented on Jun 25, 2020

    @stevenmwhite
    Contributor

    I don't think that splitting trips is something that would be acceptable to most agencies, even if it doesn't technically change the experience of the feed. I'd advise trying to approach this similarly to the way that headsign overrides are used.

    In our experience, agencies that change direction name during a trip also change the headsign. This is common for routes that go through a downtown or center city area and the headsign and direction will be something like the following:

    • First half of the trip: Headsign "Route 1, Westside via Downtown" and direction "Inbound"
    • Second half of the trip: Headsign "Route 1, Westside" and direction "Outbound"

    It's very clearly a single trip that starts on the Eastside and goes to the Westside, through Downtown on the way.

    From a headsign standpoint, this is handled well in GTFS already with trips.trip_headsign and stop_times.stop_headsign and I'd like to see us approach mid-trip direction changes in a similar way.

    @gcamp This seems fairly similar to the extended way you're already handling this, but to utilize a new directions.txt file we'd need to allow stop_times to indicate a new override for direction_id.

    (Point of order... should comments be here, on the Google doc, or both?)

  5. jamespfennell commented on Jun 25, 2020

    @jamespfennell

    Just want to chime in with the New York City subway example. The NYC Subway doesn't have any additional route directions defined in the GTFS feed, but does provide an auxiliary CSV file that provides direction names on a per stop level. The CSV file is here.

    For example, at the Port Authority station (stop ID A27), northbound trains (direction ID = false) have direction name "Uptown - Queens" and southbound trains (direction ID = true) "Downtown & Brooklyn". I use these directions to create stop headsigns for additional trips, as the realtime feed doesn't provide these.

    Probably this case of "direction names" is a totally different problem to this ticket however if it is decided to add a new file to the GTFS Static spec, it might be good to call it route_directions.txt rather than directions.txt, in order to allow future non-route direction name features to be added.

  6. gcamp commented on Jun 25, 2020

    @gcamp
    Contributor

    @gcamp This seems fairly similar to the extended way you're already handling this, but to utilize a new directions.txt file we'd need to allow stop_times to indicate a new override for direction_id.

    If we do this we would need to accept more than 0 and 1 as direction_id, because in the example mentioned it would be 4 direction names.

    Probably this case of "direction names" is a totally different problem to this ticket however

    I don't think this is a different use case, and it's exactly the way we use stop_direction_headsign in our app. If there are important enough use cases to warrant a separate text value in stop_times then it maybe it is the best way to do it.

  7. stevenmwhite commented on Jun 25, 2020

    @stevenmwhite
    Contributor

    If we do this we would need to accept more than 0 and 1 as direction_id, because in the example mentioned it would be 4 direction names.

    Good point. I had originally written something saying that route_id + direction_id wouldn't be a reasonable unique key in this case, and then edited that out of my previous comment forgetting that direction_id is currently only 0 or 1.

  8. timMillet commented on Jul 27, 2020

    @timMillet
    ContributorAuthor

    Thank you everybody for your feedback!

    I’m trying to synthesize what have been said so far (please tell me if I’m wrong or anything):

    • Everybody who commented would be in favor of adding direction names to the specification.
    • It makes sense to define direction names per route and trips.direction_id.
    • It would be useful if direction names could also be defined at the stop_time level.
    • A new .txt file can be created for this purpose, and its name should contain “route” if direction names are defined for routes only.

    Based on this feedback, MobilityData drafted 4 options for a GTFS proposal.
    You can view these options in section 4 of this Gdoc.

    • The first 2 options are directly adapted from the current implementations
      • Option A is Transit’s
      • Option B is a merge of MBTA’s, MTC’s, Trillium’s, and TriMet’s solutions
    • The last 2 options are “improved” versions of the options above, both suggesting a new .txt file and allowing the definition of direction names at the stop_time level.
      • Option C with a new stop_times.stop_direction_id
      • Option D with direction_name_ids defined at the trip and/or stop_time level

    Do you have a favorite option? Which option would be best to suit your needs?
    Would you have any other modeling solutions in mind?

    You may comment on this issue or directly in the Gdoc. Thank you!

  9. gcamp commented on Jul 28, 2020

    @gcamp
    Contributor

    I think option C and D are both better than the existing ones.

    Both would work with us but I'm curious of what other thinks of stop_direction_id. It's something we already have internal but might be a big hurdle to add for other consumers.

  10. stevenmwhite commented on Aug 7, 2020

    @stevenmwhite
    Contributor

    I find Option D to be the most flexible, particularly because that it provides multiples names per direction_id per route. I also like the fact that the same name can be used multiple times, so only one line of data is required no matter how many trips and/or stop times that use "West" as the direction.

    While direction_id makes sense as a binary value from a data perspective -- within a route there's generally only two opposite directions -- the ability to define multiple qualitative names for different trips is important.

    This is particularly true for partial trips (short lines) where the direction might be "West" even when the full trip's direction is "Southwest" because the route continues in a southern direction after going west.

  11. timMillet commented on Aug 10, 2020

    @timMillet
    ContributorAuthor

    @laurentg, @jamespfennell As you participated previously in the conversation, would you have any opinion concerning the 4 modelization options? Or anyone else?

  12. skinkie commented on Aug 10, 2020

    @skinkie
    Contributor

    In the spirit of GTFS option A would fit best, because all the other options introduce normalisation which is not found in GTFS.

  13. Bertware commented on Aug 11, 2020

    @Bertware

    I would lean towards option A or D, as they follow the same principle as the current headsigns or stop_times.shapes_id.

    However, I'm wondering what the exact difference is between trip_headsign and trip_direction_headsign? How would a data consumers show this data? I see the Stockholm metro lines being named, but aren't these already covered by the normal headsigns, given that they use the final station as a headsign/direction? I'm in favour of direction headsigns since there definitely seems to be a need for in cases where there are nortbound/southbound lines, but i feel like we could improve the specification of what should go in trip_headsign, direction_headsign, and what one should do when these are identical (should one be left out, or should consumers handle this if they don't want to show the same data twice).

  14. gcamp commented on Aug 11, 2020

    @gcamp
    Contributor

    @Bertware this is how we use the direction name at Transit. "Southbound" is a trip_direction_headsign. "Ashmont" and "Braintree" are trip_headsign. "Downtown Crossing" is the stop name.
    IMG_E78176A34E52-1

  15. skinkie commented on Aug 11, 2020

    @skinkie
    Contributor

    @gcamp you might just have proved this is an anti-feature. Because it is used at stop level rather than stop_time level.

  16. 29 remaining items

  17. stevenmwhite commented on Oct 16, 2020

    @stevenmwhite
    Contributor

    @jewel1965 I understand that completely, and we'd be in the same position considering we produce feeds for a few agencies in the Bay Area as well as many outside that region.

    In general from the GTFS spec standpoint I don't think we can really be adding new required fields or it immediately invalidates every existing feed that does currently comply and adequately describes a transit service.

  18. gcamp commented on Oct 16, 2020

    @gcamp
    Contributor

    Yes I don't think making it required is really a possibility. Making the direction name required without making the headsign required would not be logical.

  19. antrim commented on Oct 16, 2020

    @antrim
    Contributor

    Local/regional organizations can still set their own guidelines and requirements, layered over the global specification, similar to how the proposed California Minimum GTFS Requirements. MTC's GTFS Extended is another example of this, though if these direction name fields were adopted in the global GTFS, there would be two different approaches. Local requirements or guidelines can specify that fields that are optional globally are required locally. This would be best for interoperability.

  20. jewel1965 commented on Oct 16, 2020

    @jewel1965

    Does GTFS spec maintain version? If so, spec updates could be rolled out as new versions. That will allow data producers and consumers to declare their version compatibility. An 'optional' data element in one version could become 'required' in the next version. Not suggesting that this is needed for the direction name element, but thinking in general.

  21. timMillet commented on Oct 16, 2020

    @timMillet
    ContributorAuthor

    @jewel1965 GTFS is not versioned, and the current Specification Amendment Process mentions that "changes to the spec should be backward-compatible". IMHO, making required a new file like route_directions.txt is not backward-compatible, unfortunately.
    However, as Aaron stated, producers can still set their own requirements, layered over the global specification that every consumer will be able to implement.

  22. antrim commented on Nov 5, 2020

    @antrim
    Contributor

    I think the @Trillium-Solutions preferred option would be Option D with the addition of a recommendation (not requirement) that there is only 2 directions per route. (From this thread, it seems like there are cases where more than 2 directions are represented on a route.)

    It would be useful to converge on one option (even if we don't immediately vote on it), so that data providers including Trillium can begin to plan for this addition.

    Does anyone else have an update on their opinion after this discussion?

  23. stevenmwhite commented on Nov 11, 2020

    @stevenmwhite
    Contributor

    Thanks @antrim. Our preference at GMV Syncromatics would be, in this order:

    1. Option D
    2. Option A
    3. Option E

    I'd be fine supporting any of those three. Ultimately I would be against a requirement that there only be two direction names per route, but ok with a recommendation as you suggest (though perhaps a recommendation is better in a best practice document and not in the spec itself).

  24. timMillet commented on Nov 20, 2020

    @timMillet
    ContributorAuthor

    Thank you @antrim and @stevenmwhite for your feedback!
    Aaron - I added your recommendation to option D.

    For general information, here is a synthesis of what was said by everyone since my last conversation update:

    • Options A2 and D2 should be avoided, as trips of the same route-direction may have different direction names that are valid for the whole trip (e.g: stevenmwhite’s example, RER C). In these cases, options A2\D2 would force to assign direction names at the stop_time level.
    • Options A2, D2, and E allow producers and consumers to unambiguously determine the preferred direction name to associate with a representation of a route-direction (e.g: on a timetable, on an app view).
    • Options A/A2 and D/D2 are verbose (repetition of the same trip_direction_name or direction_name_id for every row for the same route_id and direction_id in trips.txt), but it’s easy for a software to duplicate a field on many rows.
  25. timMillet commented on Nov 20, 2020

    @timMillet
    ContributorAuthor

    Converging to one modelization option

    Following Aaron’s question in his last comment 15 days ago, we could say now that nobody else has an update on their opinion. So I guess It’s now the time to converge and choose one modelization, which I’ll try to do in this comment by following 3 steps:

    • Compiling everyone’s opinion (in favor or against) for each modelization option.
    • From the favorite options, highlighting the one that best meets the needs.
    • Based on the 2 steps above, suggesting the best modelization option to converge to.

    1. Community Opinions

    Below is the compilation of everyone’s opinion for each modelization option. The goal is to highlight which option has the most stakeholder in favor and the less against. We can see that:

    • Option D is the one with the most GTFS stakeholders in favor (4), but one stakeholder is against.
    • Options A, A2, and E follow with 2 GTFS stakeholders in favor, but only the option E has no stakeholders against.
    • Options B, C, and D2 received the least comments in favor.
    Modelization option Stakeholder in favor Stakeholder against
    Option A 2: Bliksem Labs B.V., Trafiklab 1: IBI Group
    Option A2 2: Metropolitan Transportation Commission, IBI Group - maybe 1: GMV Syncromatics
    Option B 0 0
    Option C 1: Transit 0
    Option D 4: Transit, GMV Syncromatics, Trafiklab, Trillium 1: IBI Group
    Option D2 1: IBI Group - maybe 1: GMV Syncromatics
    Option E 2: IBI Group, GMV Syncromatics 0

    2. Supported Needs

    Below is an array showing which needs (as defined at the beginning of the issue) are supported by the favorite options. I’ll do this exercise only with option D because it has the most GTFS stakeholders in favor, and option E because it has the most GTFS stakeholders in favor without anyone against. We can see that:

    • Option D supports all the needs but one.
    • Option E supports all the needs.
    Needs Option D Option E
    Defining direction names that are complementary to headsigns Supported Supported
    Assigning direction names at the route-direction level Not supported (but suggested in a way) Supported
    Assigning/editing direction names at the trip level Supported Supported
    Assigning/editing direction names at the stop time level Supported Supported
    Being compatible with all kind of general directions Supported Supported

    3. Best Option

    Based on these 2 points, I’d suggest moving forward with option E, even though option D has received the most opinions in favor. Option E has indeed no opponents and is the one that best meets the needs.

    If you agree or disagree with this Best Option, please react to this comment with a thumb up 👍 or down 👎 , or comment below. If you thumb down, please let me know why, also in a comment below.

  26. antrim commented on Nov 26, 2020

    @antrim
    Contributor

    Option E looks good.

  27. timMillet commented on Jan 29, 2021

    @timMillet
    ContributorAuthor

    Hi everybody,

    Thank you for your feedback! We are looking for data producers and data consumers to make the first implementations of this proposal. Please let us know if you are interested!
    You can reach us in this issue or [email protected].

  28. github-actions commented on Jan 30, 2022

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  29. added
    Status: Stale
    on Jan 30, 2022
  30. github-actions commented on Feb 13, 2022

    @github-actions

    This issue has been closed due to inactivity. Issues can always be reopened after they have been closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GTFS ScheduleStatus: Stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions