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

Enforce non-null coordinates on multimodal station #5971

Conversation

vpaturet
Copy link
Contributor

Summary

When querying a multimodal station without coordinates through the GraphQL API, the call fails with a NullPointerException:


Exception while fetching data (/trip/tripPatterns[0]/legs[5]/intermediateEstimatedCalls[7]/quay/stopPlace) : Cannot invoke "org.opentripplanner.framework.geometry.WgsCoordinate.latitude()" because the return value of "org.opentripplanner.transit.model.site.StopLocationsGroup.getCoordinate()" is null
java.lang.NullPointerException: Cannot invoke "org.opentripplanner.framework.geometry.WgsCoordinate.latitude()" because the return value of "org.opentripplanner.transit.model.site.StopLocationsGroup.getCoordinate()" is null
	at org.opentripplanner.transit.model.site.StopLocationsGroup.getLat(StopLocationsGroup.java:25)
	at org.opentripplanner.apis.transmodel.model.stop.MonoOrMultiModalStation.<init>(MonoOrMultiModalStation.java:59)
	at org.opentripplanner.apis.transmodel.model.stop.MonoOrMultiModalStation.<init>(MonoOrMultiModalStation.java:53)
	at org.opentripplanner.apis.transmodel.model.stop.QuayType.lambda$create$4(QuayType.java:125)

This PR ensures that multimodal stations without coordinates are ignored during graph building.

Issue

No

Unit tests

Updated unit tests

Documentation

No

@vpaturet vpaturet added Bug NeTEx This issue is related to the Netex model/import. labels Jul 16, 2024
@vpaturet vpaturet self-assigned this Jul 16, 2024
@vpaturet vpaturet marked this pull request as ready for review July 16, 2024 07:58
@vpaturet vpaturet requested a review from a team as a code owner July 16, 2024 07:58
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 69.64%. Comparing base (499fb93) to head (e58ff95).

Files Patch % Lines
...org/opentripplanner/netex/mapping/NetexMapper.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #5971   +/-   ##
==========================================
  Coverage      69.63%   69.64%           
- Complexity     17129    17134    +5     
==========================================
  Files           1937     1937           
  Lines          73741    73743    +2     
  Branches        7546     7547    +1     
==========================================
+ Hits           51350    51357    +7     
+ Misses         19754    19752    -2     
+ Partials        2637     2634    -3     

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

@vpaturet vpaturet force-pushed the enforce_non_null_coordinates_on_multimodal_station branch from dcbf86c to 5bc0b78 Compare July 16, 2024 13:30
@vpaturet vpaturet merged commit 8205880 into opentripplanner:dev-2.x Jul 16, 2024
5 checks passed
@vpaturet vpaturet deleted the enforce_non_null_coordinates_on_multimodal_station branch July 16, 2024 15:32
t2gran pushed a commit that referenced this pull request Jul 16, 2024
@t2gran t2gran added this to the 2.6 (next release) milestone Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug NeTEx This issue is related to the Netex model/import.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants