HSLdevcom / navigator-server

Realtime APIs for public transport
http://dev.hsl.fi
Other
9 stars 5 forks source link

Stoptimes return "realtimeDeparture": -1 #28

Closed PasiSalenius closed 7 years ago

PasiSalenius commented 7 years ago

I guess this is supposed to be fixed and should be a known issue, but adding this here as a reminder as IMHO this is quite a bad bug currently.

The following realtime stoptimes query

{
  trip(id: "HSL:2109_20170102_Ti_2_0829") {
    stoptimesForDate(serviceDay: "20170103") {
      stop {
        gtfsId
      }
      scheduledArrival
      realtimeArrival
      scheduledDeparture
      realtimeDeparture
      serviceDay
      realtime
    }
  }
}

returns "realtime": true but at the same time "realtimeArrival": -1 and "realtimeDeparture": -1

{
  "stop": {
    "gtfsId": "HSL:2631269"
  },
  "scheduledArrival": 30540,
  "realtimeArrival": -1,
  "scheduledDeparture": 30540,
  "realtimeDeparture": -1,
  "serviceDay": 1483394400,
  "realtime": true
}

This seems to affect quite a lot of stoptimes queries where realtime information is available. Digitransit clients that don't specifically code around this will display wrong data as a consequence.

hannesj commented 7 years ago

@PasiSalenius This implicates that real-time data is not available, as the bus has already passed the stop or has been cancelled. The historical data is not available in legacy HSL systems, and should finished with the LIJ project is taken into use.

PasiSalenius commented 7 years ago

Wouldn't the correct "realtime" value then be false for those stoptimes? But ok, will be waiting for the final implementation.

tuukka commented 7 years ago

In case of -1, realtime data is available but there is no time estimate as the vehicle won't visit the stop anymore.