Skip to content

Throw RoutingValidationException if origin and destination are the same#4364

Merged
hannesj merged 2 commits into
opentripplanner:dev-2.xfrom
entur:otp2_fix_origin_destinbation_equals
Aug 11, 2022
Merged

Throw RoutingValidationException if origin and destination are the same#4364
hannesj merged 2 commits into
opentripplanner:dev-2.xfrom
entur:otp2_fix_origin_destinbation_equals

Conversation

@hannesj

@hannesj hannesj commented Aug 10, 2022

Copy link
Copy Markdown
Contributor

Summary

If the origin and destination share any vertices, the user is already at their destination, and the result is a trivial path.

Issue

Closes #4350

@hannesj hannesj added the !Bug Apply to issues describing a bug and PRs witch fixes it. label Aug 10, 2022
@hannesj hannesj added this to the 2.2 milestone Aug 10, 2022
@hannesj hannesj requested a review from a team as a code owner August 10, 2022 12:04
@optionsome

Copy link
Copy Markdown
Member

We had a similar check in OTP1. I don't exactly remember why it was removed in upstream but I think I at least removed it in a fork because via point routing. Maybe we should add a TODO here to check for via points once they are implemented.

@hannesj

hannesj commented Aug 11, 2022

Copy link
Copy Markdown
Contributor Author

Maybe we should add a TODO here to check for via points once they are implemented.

We will have a separate TemporaryVerticesContainer for each segment, so it will not be an issue

@hannesj hannesj merged commit 4749432 into opentripplanner:dev-2.x Aug 11, 2022
@hannesj hannesj deleted the otp2_fix_origin_destinbation_equals branch August 11, 2022 11:20
t2gran pushed a commit that referenced this pull request Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insane itineraries returned when request origin and destination are same

3 participants