Skip to content

Conversation

hjvuor
Copy link

@hjvuor hjvuor commented Sep 23, 2025

Summary

  • This PR adds a layer group called Elevators to the debug UI that contains instances of ElevatorVertex and ElevatorHopEdge
  • To properly draw ElevatorHopEdges in case their start and end points are not at the same location, this adds a getGeometry method where the geometry is computed from the start and end vertices of the edge.

Issue

This is related to improving indoor navigation #6829

Unit tests

style.json was regenerated by DebugStyleSpecTest.java

Bumping the serialization version id

Minor changes made to both ElevatorHopEdge and ElevatorVertex which requires to bump serialization id

@hjvuor hjvuor requested a review from a team as a code owner September 23, 2025 13:26
return;
}

if (edge instanceof ElevatorHopEdge) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this still necessary?

Copy link
Author

Choose a reason for hiding this comment

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

In case of ElevatorHopEdges, the condition for early return used to happen the line before because they didn't return a geometry. So this is something I had to add as a special case.

@Override
public LineString getGeometry() {
List<Coordinate> segmentCoordinates = Arrays.asList(fromv.getCoordinate(), tov.getCoordinate());
return GeometryUtils.getGeometryFactory()
Copy link
Member

Choose a reason for hiding this comment

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

You can use GeometryUtils.makeLineString here.

Copy link

codecov bot commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 78.37838% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.10%. Comparing base (d1ef037) to head (14f0bdb).
⚠️ Report is 3 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...nner/inspector/vector/edge/EdgePropertyMapper.java 0.00% 5 Missing ⚠️
.../inspector/vector/vertex/VertexPropertyMapper.java 0.00% 1 Missing ⚠️
...tripplanner/street/model/edge/ElevatorHopEdge.java 66.66% 1 Missing ⚠️
...ripplanner/street/model/vertex/ElevatorVertex.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6885      +/-   ##
=============================================
- Coverage      72.10%   72.10%   -0.01%     
+ Complexity     19666    19665       -1     
=============================================
  Files           2125     2125              
  Lines          79522    79559      +37     
  Branches        8049     8050       +1     
=============================================
+ Hits           57341    57366      +25     
- Misses         19345    19355      +10     
- Partials        2836     2838       +2     

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leonardehrenfried
Copy link
Member

Fix the formatting please.

@tkalvas tkalvas added the +Bump Serialization Id Add this label if you want the serialization id automatically bumped after merging the PR label Sep 25, 2025
@leonardehrenfried leonardehrenfried added +OTP Debug UI OTP bundled client, the OTP server is normally not changed and removed +Bump Serialization Id Add this label if you want the serialization id automatically bumped after merging the PR labels Sep 25, 2025
@leonardehrenfried
Copy link
Member

You need to resolve conflicts.

Comment on lines +268 to +278
StyleBuilder.ofId("elevator-hop-edge")
.group(ELEVATORS_GROUP)
.typeLine()
.vectorSourceLayer(edges)
.edgeFilter(ElevatorHopEdge.class)
.lineColor(ORANGE)
.lineWidth(LINE_HALF_WIDTH)
.lineOffset(LINE_OFFSET)
.minZoom(6)
.maxZoom(MAX_ZOOM)
.intiallyHidden(),
Copy link
Member

Choose a reason for hiding this comment

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

These are slightly problematic as they are used for all elevators, but only visible for the horizontal elevators currently since the line has 0 length usually. I was thinking should we rename this so it's more clear that these will only show up for the horizontal elevators or somehow draw them as circles when they have 0 length and as lines when they don't. However, it's also possible that we don't do anything about it now.

Copy link
Author

Choose a reason for hiding this comment

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

I somewhat agree but I still think that since we don't do any special filtering for these edges we'd want the name to represent all of them. Then the ui just draws what it can

@habrahamsson-skanetrafiken habrahamsson-skanetrafiken marked this pull request as draft October 16, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

+OTP Debug UI OTP bundled client, the OTP server is normally not changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants