Skip to content

Conversation

t2gran
Copy link
Member

@t2gran t2gran commented Oct 17, 2025

Summary

  • Added distance field to PointsOnLink GraphQL type that returns the distance in meters for encoded polyline segments
  • Implemented lazy initialization pattern in EncodedPolyline to compute distance independently from polyline encoding
  • Added sumDistances(Coordinate[]) overload in GeometryUtils to support distance calculation from coordinate arrays

Issue

Closes #6981

Unit tests

  • Unit tests added/updated
  • Manual testing performed

Documentation

  • JavaDoc added for public APIs
  • User documentation not required

Changelog

✅ Relevant for changelog

Bumping the serialization version id

🟥 No changes to serialized classes - EncodedPolyline is not part of the serialized graph model

@t2gran t2gran requested a review from a team as a code owner October 17, 2025 17:28
@t2gran t2gran added this to the 2.9 (next release) milestone Oct 17, 2025
@t2gran t2gran added !New Feature A functional feature targeting the end user. Entur On Entur Roadmap Entur Test This is currently being tested at Entur labels Oct 17, 2025
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 71.69811% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.17%. Comparing base (97aed0d) to head (56aa376).
⚠️ Report is 6 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...ripplanner/api/model/geometry/EncodedPolyline.java 79.31% 5 Missing and 1 partial ⚠️
...ntripplanner/framework/geometry/GeometryUtils.java 50.00% 1 Missing and 1 partial ⚠️
...nner/graph_builder/module/ned/ElevationModule.java 0.00% 2 Missing ⚠️
...lanner/apis/transmodel/mapping/GeometryMapper.java 0.00% 1 Missing ⚠️
...s/transmodel/model/framework/PointsOnLinkType.java 90.00% 1 Missing ⚠️
...s/transmodel/model/network/JourneyPatternType.java 0.00% 1 Missing ⚠️
...transmodel/model/timetable/ServiceJourneyType.java 0.00% 1 Missing ⚠️
...ripplanner/framework/geometry/PolylineEncoder.java 66.66% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6982      +/-   ##
=============================================
- Coverage      72.19%   72.17%   -0.02%     
- Complexity     19838    19845       +7     
=============================================
  Files           2155     2155              
  Lines          80044    80084      +40     
  Branches        8082     8084       +2     
=============================================
+ Hits           57789    57804      +15     
- Misses         19407    19429      +22     
- Partials        2848     2851       +3     

☔ 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.

Comment on lines +298 to +299
/// Returns the sum of the distances in between the pairs of coordinates in meters.
/// If the number of coordinates is empty or just one(a point), then `0` is returned.

Choose a reason for hiding this comment

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

I haven't seen markdown comments in OTP before, do you think we should start using them even though they're not really supported until java 23?

It will be nice to not have to write html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Entur Test This is currently being tested at Entur Entur On Entur Roadmap !New Feature A functional feature targeting the end user.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add distance for stop-to-stop shapes, PointsOnLink Transmodel API

3 participants