Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New disambiguate_shapes() and trim_shapes() functions #32

Open
dhersz opened this issue Oct 28, 2021 · 0 comments
Open

New disambiguate_shapes() and trim_shapes() functions #32

dhersz opened this issue Oct 28, 2021 · 0 comments

Comments

@dhersz
Copy link
Member

dhersz commented Oct 28, 2021

Oftentimes the same shape_id will be assigned to trips that follow the same "general" shape, but that are actually different.

Let's say for example that shape_id 1 goes from A, to B, to C and to D.

trip_id 1 describes a trip that goes from A to C, and trip_id 2 describes a trip that goes from B to D. In my opinion, these trips should be assigned to different shapes, even though they share the same "general" path.

In practice, GTFS from many different agencies will assign the same shape (shape_id 1) to the two different trips.

This issue can be fixed in two steps:

  • First identifying the shape_ids that are shared inadequately (in this case, let's say it would rename it to 1_1 and 1_2). disambiguate_shapes()
  • Then for each distinct shape, trim it to the first and the last stops associated to the trip it describes. trim_shapes()

trim_shapes() will behave weirdly if the shapes are not disambiguated first. In the aforementioned example, should it trim to A or B? So trim_shapes() MUST call disambiguate_shapes() first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant