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

If configured, add subway station entrances from OSM to walk steps #6343

Open
wants to merge 40 commits into
base: dev-2.x
Choose a base branch
from

Conversation

leonardehrenfried
Copy link
Member

Summary

This takes over from #6076. We led @HenrikSundell down a few dead-ends which I'm sorry about.

I have analysed the problem of the inheritance of TransitEntranceVertex and StationEntranceVertex and have concluded that it's a problem that is too big to be solved in this PR.

The big question we have to answer is if we want to flatten the Vertex hierarchy and rely less on instanceOf checks to describe vertex behaviour. If we have clarified what we want (of which I'm not sure myself) we can change the code and unify TransitEntranceVertex and StationEntranceVertex.

Issue

Closes #6078

Unit tests

Tests added.

Bumping the serialization version id

✔️

cc @optionsome

HenrikSundell and others added 30 commits September 18, 2024 17:22
# Conflicts:
#	application/src/main/java/org/opentripplanner/model/plan/Entrance.java
#	application/src/main/java/org/opentripplanner/model/plan/StepEntity.java
#	application/src/main/java/org/opentripplanner/street/model/vertex/StationEntranceVertex.java
#	application/src/main/java/org/opentripplanner/street/model/vertex/VertexFactory.java
#	application/src/main/java/org/opentripplanner/transit/service/datafetchers/StepEntityTypeResolver.java
#	doc/user/BuildConfiguration.md
Co-authored-by: Joel Lappalainen <lappalj8@gmail.com>
Co-authored-by: Joel Lappalainen <lappalj8@gmail.com>
@leonardehrenfried leonardehrenfried added New Feature bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR Config Change labels Dec 18, 2024
@leonardehrenfried leonardehrenfried requested a review from a team as a code owner December 18, 2024 11:24
@leonardehrenfried
Copy link
Member Author

@optionsome I have a question: if we don't expose ENTER_OR_EXIT_STATION at all and use the entrance() method is a step has one, do we even need it at all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw can you rename this class to follow the class naming convention, idk why this is the only file that doesn't follow it. Hopefully the renaming doesn't mess up git history.

if (includeOsmSubwayEntrances && node.isSubwayEntrance()) {
String ref = node.getTag("ref");

boolean accessible = node.isTag("wheelchair", "yes");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has three states instead of two, use the unknown one when the tag isn't specified.

"Station entrance or exit, originating from OSM or GTFS data."
type Entrance {
"Short text or a number that identifies the entrance or exit for passengers. For example, `A` or `B`."
code: String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @t2gran wanted this to be called publicCode, but I don't have a strong preference for either way. The public doesn't really make it more understandable for me but I'm used to the stop code concept.

@optionsome
Copy link
Member

@optionsome I have a question: if we don't expose ENTER_OR_EXIT_STATION at all and use the entrance() method is a step has one, do we even need it at all?

@t2gran wanted to use enum to determine which "feature" is available, but I don't know if we save any lines of code by checking the enum value vs checking that x feature is non-null when we add support for more features.

@optionsome
Copy link
Member

Can you add a bit of documentation for the RelativeDirection enum in the schema as well to document this CONTINUE/ENTER_STATION/EXIT_STATION relationship.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR Config Change New Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subway entrance names
3 participants