Consume GTFS-RT Vehicle Positions, introduce API - #3981
Merged
leonardehrenfried merged 41 commits intoMar 22, 2022
Conversation
leonardehrenfried
force-pushed
the
vehicle-positions
branch
from
March 14, 2022 10:26
ee689b2 to
bcb730d
Compare
leonardehrenfried
force-pushed
the
vehicle-positions
branch
from
March 14, 2022 10:52
d7f371b to
007bb2f
Compare
hannesj
previously approved these changes
Mar 18, 2022
optionsome
reviewed
Mar 21, 2022
leonardehrenfried
force-pushed
the
vehicle-positions
branch
from
March 21, 2022 10:47
2ee1e54 to
68e05fe
Compare
leonardehrenfried
force-pushed
the
vehicle-positions
branch
from
March 21, 2022 10:58
68e05fe to
ca82abb
Compare
leonardehrenfried
force-pushed
the
vehicle-positions
branch
from
March 21, 2022 11:41
c1e9f00 to
e653862
Compare
optionsome
reviewed
Mar 21, 2022
Co-authored-by: Joel Lappalainen <lappalj8@gmail.com>
Co-authored-by: Joel Lappalainen <lappalj8@gmail.com>
hannesj
approved these changes
Mar 22, 2022
optionsome
approved these changes
Mar 22, 2022
optionsome
left a comment
Member
There was a problem hiding this comment.
This is undoing @t2gran work on the data fetchers. I guess it's better to use the version that is automatically generated instead of always rerunning the intellij refactor thingy?
Member
Author
Yes, after you left we decided the following: we will keep the |
t2gran
pushed a commit
that referenced
this pull request
Mar 22, 2022
vesavlad
added a commit
to opentransportro/OpenTripPlanner
that referenced
this pull request
Apr 3, 2022
Consume GTFS-RT Vehicle Positions, introduce API # Conflicts: # src/ext/java/org/opentripplanner/ext/legacygraphqlapi/LegacyGraphQLIndex.java # src/ext/java/org/opentripplanner/ext/legacygraphqlapi/generated/LegacyGraphQLDataFetchers.java # src/ext/java/org/opentripplanner/ext/legacygraphqlapi/generated/LegacyGraphQLTypes.java # src/main/java/org/opentripplanner/model/TripPattern.java # src/main/java/org/opentripplanner/updater/DataSourceType.java # src/main/java/org/opentripplanner/updater/UpdatersParameters.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a graph updater that downloads GTFS-RT Vehicle Position feeds. It keeps an internal data model and accounting for them and adds the entities to the legacy graphql API.
This is a port of what IBI added to their 1.5 fork last year: ibi-group#63
The main difference is that the positions are not added directly to the
TripPatterninstances but they are stored in a separate service just as the realtime alerts are.Configuration
To use it add the following to
router-config.jsonYou can query them in the legacy GraphQL API like this:
Future work
This solution provides an easy to consume API for drawing a couple of dozen vehicles on a map, but is not really suitable for fetching a large number of quickly updating positions. For such a system a streaming approach (MQTT, websockets, ...) would superior. Once IBI has streaming data sources and the need to draw a large number of updates on a screen, they might contribute a solution for this.
Unit tests
Both the parser and the matcher/service have tests.
Code style
Yes.
Documentation
Yes.
/cc @miles-grant-ibigroup @demory