HSLdevcom / transitdata

transitdata publishes GTFS Realtime interfaces
European Union Public License 1.2
10 stars 3 forks source link

Enable creating & handling partial cancellations (i.e. stop cancellations) #81

Closed hellej closed 4 years ago

hellej commented 4 years ago

Let's consider the comment from Kenta in planning this: HSLdevcom/transitdata-omm-cancellation-source/issues/7

Currently stop cancellations are produced by stop estimates which themselves are produced max one day ahead, i.e. with current implementation stop cancellations cannot be created into future.

Solution would be to implement a new internal message for stop cancellations and create stop cancellations based on rows for closed stops in OMM database. This way stop cancellations would not be dependent on stop estimates.

These need to be saved to transitlog as well (HSLdevcom/transitlog-ui/issues/499 / HSLdevcom/transitlog-ui/issues/386)

hellej commented 4 years ago

To my understanding, stop cancellations are not filtered out in transitdata-pubtrans-source (arrival/departure) nor in tripupdate-processor, but could it be this (in stop-estimates/PubtransStopEstimatesFactory.java):

InternalMessages.StopEstimate.Status scheduledStatus = (pubtransData.common.getState() == 3L) ?
        InternalMessages.StopEstimate.Status.SKIPPED :
        InternalMessages.StopEstimate.Status.SCHEDULED;

It seems that these are already being produced if cancelled stop estimates do go with the value 3 as state (?). I tried to find it from the Noptis specs but couldn't.