Skip to content

Enforce non-null coordinates on multimodal station - #5971

Merged
vpaturet merged 3 commits into
opentripplanner:dev-2.xfrom
entur:enforce_non_null_coordinates_on_multimodal_station
Jul 16, 2024
Merged

Enforce non-null coordinates on multimodal station#5971
vpaturet merged 3 commits into
opentripplanner:dev-2.xfrom
entur:enforce_non_null_coordinates_on_multimodal_station

Conversation

@vpaturet

Copy link
Copy Markdown
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 Apply to issues describing a bug and PRs witch fixes it. +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
@codecov

codecov Bot commented Jul 16, 2024

Copy link
Copy Markdown

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
Comment thread src/test/java/org/opentripplanner/netex/mapping/MultiModalStationMapperTest.java Outdated
@vpaturet
vpaturet merged commit 8205880 into opentripplanner:dev-2.x Jul 16, 2024
@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 Apply to issues describing a bug and PRs witch fixes it. +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