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

Unified solution to nearby stop finding #6172

Open
habrahamsson-skanetrafiken opened this issue Oct 17, 2024 · 0 comments
Open

Unified solution to nearby stop finding #6172

habrahamsson-skanetrafiken opened this issue Oct 17, 2024 · 0 comments

Comments

@habrahamsson-skanetrafiken
Copy link
Contributor

There are some architectural problems with the code for finding nearby stops.

Nearby stop finding is implemented in two separate places:

  • org.opentripplanner.routing.graphfinder.GraphFinder
  • org.opentripplanner.graph_builder.module.nearbystops.NearbyStopFinder

These implementations have some differences, here are the main differences:

  • GraphFinder has support for finding nearby Places as well as Stops.
  • GraphFinder has a maxDistance parameter.
  • NearbyStopFinder has Duration and MaxStopCount parameters.
  • NearbyStopFinder takes AreaStops into account while GraphFinder does not.
  • NearbyStopFinder fetches the whole search tree and traverses it again in order to find the stops. This could probably be optimized by using a TraverseVisitor as is done in StreetGraphFinder.
  • NearbyStopFinder is located in the graph_builder package even though it is being used in routing during AccessEgress search.

Proposed solution:

Create a single unified approach to nearby stop finding. The new stop finder should support the superset of configuration parameters from the two current solutions.

Is your feature request related to a problem? Please describe.

Duplicated code and different approaches causes more maintenance burden and more code we have to understand.

Goal / high level use-case

  • Simplify the overall code of OTP.
  • Remove dependencies from routing to graph_builder.

Describe alternatives you've considered

  • Leave it as it is.
  • Only move the NearbyStopFinder. This would get rid of the dependency to graph_builder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant