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

Process boarding location for linear platforms #6247

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

Conversation

miklcct
Copy link
Contributor

@miklcct miklcct commented Nov 11, 2024

Summary

This adds the processing of boarding locations on linear platforms.

Fixes #6056

Unit tests

added

Documentation

None

Bumping the serialization version id

No longer needed

@t2gran t2gran added this to the 2.7 (next release) milestone Nov 12, 2024
@leonardehrenfried
Copy link
Member

leonardehrenfried commented Nov 12, 2024

We talked about this today and we came to the conclusion that we want to introduce a data structure that is available during graph build only and then discarded. Lets discuss this in a meeting.

@miklcct
Copy link
Contributor Author

miklcct commented Nov 12, 2024

Does moving the LinearPlatform field into StreetEdge and marking it as transient achieve the above, and avoid a serialisation bump?

@leonardehrenfried
Copy link
Member

Unfortuntately not. We want to design a new system for keeping information that is used during graph build only and then discarded.

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 83.83838% with 16 lines in your changes missing coverage. Please review.

Project coverage is 69.88%. Comparing base (5f9b448) to head (eaafc68).
Report is 14 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...aph_builder/module/OsmBoardingLocationsModule.java 88.88% 1 Missing and 4 partials ⚠️
...rg/opentripplanner/graph_builder/GraphBuilder.java 0.00% 3 Missing ⚠️
...ner/standalone/configure/ConstructApplication.java 0.00% 3 Missing ⚠️
..._builder/module/configure/GraphBuilderModules.java 0.00% 1 Missing ⚠️
...o/internal/DefaultOsmInfoGraphBuildRepository.java 87.50% 1 Missing ⚠️
...info/internal/DefaultOsmInfoGraphBuildService.java 80.00% 1 Missing ⚠️
...n/java/org/opentripplanner/standalone/OTPMain.java 0.00% 1 Missing ⚠️
...pplanner/standalone/configure/LoadApplication.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6247      +/-   ##
=============================================
+ Coverage      69.85%   69.88%   +0.03%     
- Complexity     17921    17950      +29     
=============================================
  Files           2035     2038       +3     
  Lines          76495    76581      +86     
  Branches        7824     7826       +2     
=============================================
+ Hits           53434    53519      +85     
- Misses         20324    20327       +3     
+ Partials        2737     2735       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@miklcct miklcct marked this pull request as ready for review December 5, 2024 15:54
@miklcct miklcct requested a review from a team as a code owner December 5, 2024 15:54
@habrahamsson-skanetrafiken
Copy link
Contributor

@t2gran will come with some suggestions of how to solve this without adding anything to the serialized graph.

@t2gran
Copy link
Member

t2gran commented Dec 13, 2024

There is one thing I do not understand here. Is it true that in the OSM model the boarding reference can be on both way and node, and that it is only on Vertex in OTP? If so, why are we not just coping the boarding references to the vertexes it is connected to?

I think the correct behavior for the routing would be to "arrive at the stop" when you arrive at one of the vertexes included in the platform.

@miklcct
Copy link
Contributor Author

miklcct commented Dec 13, 2024

I think your behaviour is correct but it isn't supported even for the area platforms yet. The centroid is currently calculated and used.

Maybe I should try to connect the stop to every vertexes instead (and also do it for area platforms as well)

@t2gran
Copy link
Member

t2gran commented Dec 13, 2024

I am almost done with storing the refs between builders, so I will publish that here when I am done. Lets, discuss this on Tuesday again. I would like some feedback from the "AStar experts" on how to NOT model a stop as a point? This is likely to be a bigger refactoring, but for some stops modeling it as a point is problematic.

…modules

The Repository and Service is not available during routing, only during
the graph build.
@t2gran
Copy link
Member

t2gran commented Dec 17, 2024

Here is how you can excange data between builders - the data is persserved during serialization:

3825a02

@habrahamsson-skanetrafiken habrahamsson-skanetrafiken requested review from vesameskanen and removed request for vesameskanen December 17, 2024 10:11
Comment on lines +169 to +178
Platform platform = platformEdgeList.getKey();
var name = platform.name();
var label = "platform-centroid/%s".formatted(stop.getId().toString());
var centroid = platform.geometry().getCentroid();
var boardingLocation = vertexFactory.osmBoardingLocation(
new Coordinate(centroid.getX(), centroid.getY()),
label,
platform.references(),
name
);
Copy link
Member

Choose a reason for hiding this comment

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

This is copy&paste. Please extract a method.

@@ -99,14 +113,14 @@ public void buildGraph() {
}

private boolean connectVertexToStop(TransitStopVertex ts, StreetIndex index) {
Copy link
Member

Choose a reason for hiding this comment

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

This method is getting too large. Please extract three methods for the three cases:

  1. Node
  2. Area
  3. Way

Move the inline comments into Javadoc.

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

Successfully merging this pull request may close these issues.

Boardinglocations on ways don't seem to work as expected
4 participants