Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #6076
base: dev-2.x
Are you sure you want to change the base?
If configured, add subway station entrances from OSM to walk steps #6076
Changes from 23 commits
1d19a05
67f4b1b
9d18269
3b88288
0a62bf8
528ab55
3e4ae96
401a405
438bc31
97c2de6
d844561
02a07ea
5dc74dd
5d55646
d1067c6
5c97ad1
e10e0a2
34761fe
c84b7cf
2ea8a52
39b0db3
3b6bf3f
36be3dc
c9df52d
7a9a8f6
c9139e3
7b21024
ce7719c
b737411
f547e07
18b84f0
2060016
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import org.opentripplanner.framework.graphql.GraphQLUtils and just use
GraphQLUtils.getTranslation
. Also, you can mark theinput
parameter in the getTranslation method as nullable and just pass in the entrance's name to the method as it does the null checks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for the full path is that
org.opentripplanner.apis.gtfs.GraphQLUtils
is already imported.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should say "subway stations's entrance" instead of building here. Also since there is already
getExit
here, maybe rename this and the highway exit rename methods so it's really clear that one is for highways, and the other is for stations.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to se a diagram with boxes - forget about the class design for a moment and just draw the things we want to add in the future (next 1- 2 years). Then we can discuss how to group them and map the relationship.
Return an
Object
is no-go, and so isEntrance extends StepEntity
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I drew some sort of a process diagram with boxes together with @HenrikSundell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method should probably still return StepEntity instead of Object but I think the step impl must return an Object for the entity which is then handled by StepEntityTypeResolver. It's possible that instead of doing the instanceof checks that are currently done to return correct schema types, we could cast the object to a StepEntity and then check if entrance field is non-null, or escalator field is non-null etc., but I'm not sure how much cleaner that solution is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just quickly tested and seems like it's possible to define a class that is used for an union from GraphQL (through codegen configuration). So with this current setup where the different entity types would have a shared base class, you could use that for the union. However, if they don't, then you need to return an Object from the
stepImpl#entity()
method.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New diagram