Open pserwylo opened 7 years ago
Actually first I would check with them if they plan to include realtime data in their EFA. Because if they don't do that, they will never get proper journey planning based on realtime data. And it would save us from a lot of trouble.
I would assume the JSON feed does not nearly return enough data to completely replace the XML EFA station monitor. So two requests would be hard to avoid, and at the same time this introduces questions like what if one of the two fails? Do the station IDs match up beween the two systems?
For this reason, I would suggest starting with a subclass. I guess for most users it's actually a feature if they don't get the behaviour changed drastically, and replacing "new MetProvider" with "new MetRtProvider" seems rather trivial to me.
Thanks for the quick respons @schildbach. Appreciate your patience as I'm trying to figure out how to proceed.
I will get in touch with them and ask about the XML feed as you suggested. In addition, I'm happy to create a MetRtProvider
class if need be, though I also see no problem with changing the behaviour of the existing one, so that it adheres closer to the NetworkProvider
interface (e.g. queryDepartures()
states in its documentation that it may provide realtime info, and it seems to me that anyone who makes use of a NetworkProvider
would therefore take into account that info may be realtime or scheduled).
With regards to their XML feed, I note that they publish their own (what seems to me to be proprietary and unique) API:
Is this common among other transport providers? Or would you suspect that they are really just proxying one of the existing providers that is already supported by public-transport-enabler?
If it is in fact their own new API that is distinct from others, should it be treated like such by implementing an entire new MetRtProvider
that doesn't extend AbstractEfaProvider
at all?
Cheers.
I wasn't sure if I should open a new issue for this or not, but I thought I'd mention that MetProvider is no longer working. The app is throwing UnexpectedRedirectException errors since the journey planner no longer exists at http://jp.ptv.vic.gov.au/ptv/.
Yes, they shut off their EFA. I still have some hope they revise their decision.
About two years ago support for realtime departures was added to the Melbourne bus network. I'd like to add support for it to public-transport-enabler, but wanted to get some feedback before continuing (having not contributed here before).
Here is some quick info about the situation:
AbstractEfaProvider
I see one main option, but am happy to be told otherwise:
AbstractHafasProvider
includesjsonStationBoard
to be called by its subclasses inqueryDepartures()
if required. This would involve:queryDepartures()
inMetProvider
queryDepartures()
and try to merge the data together.So my main questions are:
queryDepartures()
if required?MetRtProvider
that extends MetProvider, or should I just add it to the
MetProviderdirectly? (My preference is to add it to
MetProviderso that users of this library get access to realtime data without having to change their code to support
MetRtProvider`).Thanks.