Skip to content

Conversation

@tkalvas
Copy link
Contributor

@tkalvas tkalvas commented Dec 12, 2025

Summary

VR has NeTEx data where a ServiceLink is expressed as

            <ServiceLink version="1" id="FIN:ServiceLink:-255790224">
              <projections>
                <LinkSequenceProjection version="any" id="FIN:LinkSequenceProjection:-
255790224">
                  <gml:LineString srsName="WGS84" gml:id="FIN_LineString_-255790224">
                    <gml:pos>63.097865 21.621837</gml:pos>
                    <gml:pos>63.095728 21.627846</gml:pos>
                    <gml:pos>63.095728 21.627846</gml:pos>

This adds support for it.

GML documentation extract for LineString:

GML supports two different ways to specify the control points of a line string. 1. A sequence of "pos" (DirectPositionType) or "pointRep" (PointPropertyType) elements. "pos" elements are control points that are only part of this curve, "pointRep" elements contain a point that may be referenced from other geometry elements or reference another point defined outside of this curve (reuse of existing points). 2. The "coordinates" element allows for a compact way to specifiy the coordinates of the control points, if all control points are in the same coordinate reference systems and belong to this curve only. The number of direct positions in the coordinates list must be at least two.

We only supported 2, but this PR adds 1 as well.

Unit tests

Yes.

Documentation

Rationale given in this comment.

Changelog

Yes.

Bumping the serialization version id

No.

@tkalvas tkalvas requested a review from a team as a code owner December 12, 2025 09:24
@tkalvas tkalvas marked this pull request as draft December 12, 2025 09:24
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 68.75000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.09%. Comparing base (6d59a52) to head (992c34d).
⚠️ Report is 187 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...entripplanner/netex/mapping/ServiceLinkMapper.java 68.75% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #7135      +/-   ##
=============================================
+ Coverage      72.05%   72.09%   +0.03%     
- Complexity     20679    20695      +16     
=============================================
  Files           2242     2244       +2     
  Lines          83801    83913     +112     
  Branches        8348     8350       +2     
=============================================
+ Hits           60385    60495     +110     
+ Misses         20488    20487       -1     
- Partials        2928     2931       +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.

@leonardehrenfried
Copy link
Member

Related: #5697

You might be able to use the test.

@tkalvas tkalvas marked this pull request as ready for review December 18, 2025 10:26
@tkalvas tkalvas changed the title support geometry format with list of gml:pos elements Support gml:LineString format with list of gml:pos elements Dec 18, 2025
@tkalvas tkalvas added the !Bug Apply to issues describing a bug and PRs witch fixes it. label Dec 18, 2025
if (o instanceof DirectPositionType directPosition) {
var values = directPosition.getValue();
if (values == null || values.size() != 2) {
System.out.println("bad lineString element value " + values);
Copy link
Member

@leonardehrenfried leonardehrenfried Dec 18, 2025

Choose a reason for hiding this comment

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

Can you get rid of the System.out.println?

}
list.addAll(values);
} else {
System.out.println("unhandled lineString element type " + o.getClass().getName());
Copy link
Member

Choose a reason for hiding this comment

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

Can you replace this with slf4j or remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's build-time, so I changed it to issueStore.add instead

@tkalvas tkalvas added this pull request to the merge queue Dec 19, 2025
Merged via the queue into opentripplanner:dev-2.x with commit 9aa668b Dec 19, 2025
8 checks passed
@tkalvas tkalvas deleted the service-link-mapper-direct-coordinates branch December 19, 2025 13:44
t2gran pushed a commit that referenced this pull request Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants