Problems with /Line/Timetable

Here are some intial problems I have found with this set of calls. I am using /Line/Route (no parameters) to generate a list of line/originating stop/direction entries and then iterating through that set.

First off, a repeat of a comment that’s been made elsewhere in the forum. The optional direction parameter is necessary for disambiguation in a number of cases but is totally undocumented in Swagger.

Next, all rail-related calls (including london-overground and tfl-rail) return a set where the stations and stops sections are populated, but the timetable section isn’t. The statusErrorMessage for all of these is ‘The stop you selected has now been removed from the route, and therefore we cannot show you a timetable. The route page will be updated shortly to reflect these changes.’

The same problem occurs with the following bus routes:

  • 75/490001177Z/outbound
  • 75/490006706C13/inbound
  • 434/40004410113A/inbound
  • e11/490007441H/outbound

There are two rail sections that fail ‘HTTP error 400 Bad Request’, these are:

  • cross-country/0000BRSTLTM1/inbound
  • south-western-railway/0000BKNHRST1/outbound
    It looks to me as if you are including the TIPLOC suffix as part of the code and then failing to translate it to a NAPTAN code.

The following entries fail ‘HTTP error 500 Internal Server Error’:

  • 139/490000087GF/outbound
  • e1/490007441H/outbound
  • n53/490019475P/inbound
  • r7/490005081Z/outbound

There are also a number of entries where the originator, derived from /Line/Route does not match the departureStopId in the timetable, these are:

  • 24/490015832E/outbound departure stop 490011003E does not match originator
  • 40/490006232W1/outbound departure stop 490015428N does not match originator
  • 108/490018554E1/outbound departure stop 490018554E does not match originator
  • 134/490000252E/inbound departure stop 490000252X does not match originator
  • 162/490001018A/outbound departure stop 490015222D does not match originator
  • 221/490015287E/outbound departure stop 490000070A does not match originator
  • 223/490000256/inbound departure stop 490000256F does not match originator
  • 240/490015287E/inbound departure stop 490000070A does not match originator
  • 241/490013802W/inbound departure stop 490003750M does not match originator
  • 294/490007917E/outbound departure stop 490007917W does not match originator
  • 371/490018720S/outbound departure stop 490018720W does not match originator
  • 404/490005640G/outbound departure stop 490005637C does not match originator
  • 474/490013802W/outbound departure stop 490003750M does not match originator
  • 483/490015231T/outbound departure stop 490015230P does not match originator
  • b12/490012799E/inbound departure stop 490012799W does not match originator
  • k1/490007205S/inbound departure stop 490007205N does not match originator
  • n83/490015231T/inbound departure stop 490015230P does not match originator
  • n97/490013767X/inbound departure stop 490013767S does not match originator
  • r5/490007494PA/inbound departure stop 490007494DC does not match originator
  • r10/490007494PA/inbound departure stop 490007494DC does not match originator
    In most cases the departure stop is the second stop shown in the corresponding /Line/Route/Sequence call (4th in the case of lines 223 & 404 and considerably later for lines B12, R5 & R10). In all cases this appears to be caused by the route having a subsequent stop in the same NAPTAN group

All these comments are based on the update dated 8/8/2019

Result of update dated 14/8/2019:

No timetable: all rail, 75, 434 as before, e11 fixed, 197/490015223C10/inbound added
Error 400: as before
Error 500: all fixed
Mismatched departure stop: as before

Additionally, hereast-shuttle/490001338Z/outbound has stations, stops and schedules, but no stationIntervals. The intervalId for all knownJourneys is -1.

Result of update dated 20/8/2019:

As last week, except hereeast-shuttle has disappeared altogether

Result of update dated 29/8/2019:

No timetable: all rail, 75, 197, 434 as before, 195/490004289C/inbound added
Error 400: thameslink/9100GCAMBNTH0/inbound
Error 500: 68/490000077E/inbound and n38/490014050D/inbound
Mismatched departure stops: as before, add
Timetable 44/490000248G/outbound departure stop 490014050R does not match originator

Result of update dated 30/8/2019 (published 2/9/2019):

No timetable: all rail and:

No route sections for 75/490001177Z/outbound
No route sections for 75/490006706C13/inbound
No route sections for 434/40004410113A/inbound

Error 400:

Error loading timetable data for thameslink/9100CAMBNTH0/outbound: ##HTTP 400 Bad Request

Error 500:

Error loading timetable data for 160/490001249F/inbound: ##HTTP 500 Internal Server Error
Error loading timetable data for e9/490007913E/inbound: ##HTTP 500 Internal Server Error
Error loading timetable data for n277/490008507N2/inbound: ##HTTP 500 Internal Server Error

Mismatched departure stops:

Timetable 24/490015832E/outbound departure stop 490011003E does not match originator
Timetable 40/490006232W1/outbound departure stop 490015428N does not match originator
Timetable 44/490000248G/outbound departure stop 490014050R does not match originator
Timetable 108/490018554E1/outbound departure stop 490018554E does not match originator
Timetable 134/490000252E/inbound departure stop 490000252X does not match originator
Timetable 162/490001018A/outbound departure stop 490015222D does not match originator
Timetable 221/490015287E/outbound departure stop 490000070A does not match originator
Timetable 223/490000256/inbound departure stop 490000256F does not match originator
Timetable 240/490015287E/inbound departure stop 490000070A does not match originator
Timetable 241/490013802W/inbound departure stop 490003750M does not match originator
Timetable 294/490007917E/outbound departure stop 490007917W does not match originator
Timetable 371/490018720S/outbound departure stop 490018720W does not match originator
Timetable 404/490005640G/outbound departure stop 490005637C does not match originator
Timetable 474/490013802W/outbound departure stop 490003750M does not match originator
Timetable 483/490015231T/outbound departure stop 490015230P does not match originator
Timetable 686/49000012262N/outbound departure stop 490012662E does not match originator
Timetable b12/490012799E/inbound departure stop 490012799W does not match originator
Timetable k1/490007205S/inbound departure stop 490007205N does not match originator
Timetable n83/490015231T/inbound departure stop 490015230P does not match originator
Timetable n97/490013767X/inbound departure stop 490013767S does not match originator
Timetable r5/490007494PA/inbound departure stop 490007494DC does not match originator
Timetable r10/490007494PA/inbound departure stop 490007494DC does not match originator

Result of update dated 3/9/2019:

No timetable:
as previous

Error 400:

Error loading timetable data for cross-country/0000BRSTLTM1/inbound: ##HTTP 400 Bad Request
Error loading timetable data for south-western-railway/0000BKNHRST1/outbound: ##HTTP 400 Bad Request

Error 500:
none

Mismatched departure stops:
as previous

No interval sets:

Timetable hereeast-shuttle/490001338Z/outbound: no interval sets

Result of update dated 6/9/2019:

No timetable: all rail, including london-overground and tfl-rail, as well as the ones shown below

Errors from my logs - note that HTTP errors are after multiple retries:

Timetable 24/490015832E/outbound departure stop 490011003E does not match originator
Timetable 40/490006232W1/outbound departure stop 490015428N does not match originator
Timetable 44/490000248G/outbound departure stop 490014050R does not match originator
Timetable 108/490018554E1/outbound departure stop 490018554E does not match originator
Timetable 134/490000252E/inbound departure stop 490000252X does not match originator
Timetable 162/490001018A/outbound departure stop 490015222D does not match originator
Timetable 221/490015287E/outbound departure stop 490000070A does not match originator
Timetable 223/490000256/inbound departure stop 490000256F does not match originator
Timetable 240/490015287E/inbound departure stop 490000070A does not match originator
Timetable 241/490013802W/inbound departure stop 490003750M does not match originator
Timetable 294/490007917E/outbound departure stop 490007917W does not match originator
Timetable 371/490018720S/outbound departure stop 490018720W does not match originator
Timetable 404/490005640G/outbound departure stop 490005637C does not match originator
Timetable 474/490013802W/outbound departure stop 490003750M does not match originator
Timetable 483/490015231T/outbound departure stop 490015230P does not match originator
Timetable 686/49000012262N/outbound departure stop 490012662E does not match originator
Timetable b12/490012799E/inbound departure stop 490012799W does not match originator
Timetable k1/490007205S/inbound departure stop 490007205N does not match originator
Timetable n83/490015231T/inbound departure stop 490015230P does not match originator
Timetable n97/490013767X/inbound departure stop 490013767S does not match originator
Timetable r5/490007494PA/inbound departure stop 490007494DC does not match originator
Timetable r10/490007494PA/inbound departure stop 490007494DC does not match originator

No route sections for 52/490014050C/outbound: The stop you selected has now been removed from the route, and therefore we cannot show you a timetable. The route page will be updated shortly to reflect these changes.
No route sections for 75/490001177Z/outbound: The stop you selected has now been removed from the route, and therefore we cannot show you a timetable. The route page will be updated shortly to reflect these changes.
No route sections for 75/490006706C13/inbound: The stop you selected has now been removed from the route, and therefore we cannot show you a timetable. The route page will be updated shortly to reflect these changes.
No route sections for 95/490012241N/outbound: The stop you selected has now been removed from the route, and therefore we cannot show you a timetable. The route page will be updated shortly to reflect these changes.
No route sections for 185/490000248YZ/inbound: The stop you selected has now been removed from the route, and therefore we cannot show you a timetable. The route page will be updated shortly to reflect these changes.
No route sections for 419/490003632BF/inbound: The stop you selected has now been removed from the route, and therefore we cannot show you a timetable. The route page will be updated shortly to reflect these changes.
No route sections for 434/40004410113A/inbound: The stop you selected has now been removed from the route, and therefore we cannot show you a timetable. The route page will be updated shortly to reflect these changes.
No route sections for westminster-passenger-service-association/930GWMR/outbound: The stop you selected has now been removed from the route, and therefore we cannot show you a timetable. The route page will be updated shortly to reflect these changes.

Error loading timetable data for cross-country/0000BRSTLTM1/inbound: ##HTTP 400 Bad Request
Error loading timetable data for south-western-railway/0000BKNHRST1/outbound: ##HTTP 400 Bad Request
Error loading timetable data for 640/490000211F/outbound: ##HTTP 500 Internal Server Error
Error loading timetable data for e8/490013259U/outbound: ##HTTP 503 Service Unavailable

Timetable hereeast-shuttle/490001338Z/outbound: no interval sets

Update dated 9/9/2019 onwards:

I’m not going to do any more weekly updates here, but will report as and when issues are fixed or new ones appear

Update dated 25/9/2019:

No interval entries: Circle, Hammersmith & City, Metropolitan/inbound

DLR/inbound: no entries for Poplar/West India Quay-Bank/Tower Gateway, Beckton-Canning Town & Canning Town-Poplar have no intermediate stops
DLR/outbound: Bank/Tower Gateway-Canary Wharf/Poplar and Poplar-Canning Town have no intermediate stops, no entries for Canning Town-Beckton
Metropolitan/outbound: only Amersham/Chesham-Rickmansworth, Chesham-Watford & Watford-Croxley

Update dated 1/10/2019:

This has fixed the problems from last week, all the other issues are still outstanding

Just a gentle reminder - lots still outstanding here

@nickp I’ve made a start and my notes on your first post are below:

Optional Swagger Direction

Already raised under SVC-3456 - it’s been sitting on the backlog for a while now and I’ll see if this can be prioritised into a development sprint.

London Overground & TfL Rail

I’m not sure why, but we’ve never had the ability to query National Rail (inc LO/TfL Rail) timetables using the timetable API we have in the Journey Planner. I’ll take a look into if this is possible. However, it may be some time before we can expose this via the Unified API.

Buses - Stop removed from route
75/490001177Z/outbound - appears fixed
75/490006706C13/inbound - appears fixed
434/40004410113A/inbound - seems like there is a mismatch in the data provided by Surrey County Council to the NaPTAN and the data provided by TfL Surface Transport. We will investigate under SVC-6890
e11/490007441H/outbound - appears fixed

Rail - 0000 prefixes
These routes are imported from National Rail data. I’ve found another routesection affected (Waterloo - Westbury, Wilts) but there. I’ve raised SVC-6891 to investigate this.

Buses - 500 errors
139/490000087GF/outbound - appears fixed
e1/490007441H/outbound - appears fixed
n53/490019475P/inbound - appears fixed
r7/490005081Z/outbound - appears fixed

Buses - departureStopId does not match originator

This seems to be driven from when 2 stops on the route exist in the same StopArea (NaPTAN) or HUB area (Unified API). I’ve raised ticket SVC-6892 to look into why the latter stop is being returned as the departureStopId.

1 Like

@jamesevans Thanks for that.

To give you some more recent data, here’s the position as of the update dated 23/12/2019:

Buses - Stop removed from route
83/490000087GH/outbound
148/490003375WK/inbound
434/40004410113A/inbound

Buses - 500 errors
612/490011990N/outbound
k5/490006283E/outbound

Buses - no interval sets
hereeast-shuttle/490001338Z/outbound

no interval sets in stationIntervals and all knownJourneys have intervalId set to -1

Buses - departure stop does not match originator
This is basically the same list as in my original post

Rail - 0000 prefixes
cross-country/0000BRSTLTM1/inbound
great-western-railway/0000BSNGSTK1/outbound
scotrail/0000PSLYGST3/inbound
south-western-railway/0000BKNHRST1/outbound

I dont know where National Rail’s TIPLOC codes are converted to NAPTAN codes by the addition of a 910G prefix but, as I mentioned previously, this appears to be caused by the inclusion of the platform number in the code before lookup/conversion. As well as their inclusion in the timetable data, there are 63 of these ‘0000’ codes in the /Line/Route/Sequence data

Rail - including LO/TflRail
Although you say that the API has historically not had access to this data, /Line/Route (no parameters) nevertheless returns a list of potential starting points for all the rail services, so there is some data present to cause this, it’s only the detail calls that get the rejection message. As a simple example, the following locations are returned for c2c:
c2c/910GFENCHRS/outbound
c2c/910GLIVST/outbound
c2c/910GSHBRYNS/inbound

1 Like

Another wrinkle in the update dated 2/3/2020:

As well as all the problems detailed above, route 192/outbound has the last stop (Tottenham Hale Bus Station/490009917AP) duplicated. This does not appear in /Line/Route/Sequence
Edit:
A little bit of defensive coding later, we find:
Stop 490000054CA skipped, same as previous in 125/outbound/0
Stop 490009917AP skipped, same as previous in 192/outbound/0
Stop 40004402075A skipped, same as previous in 203/inbound/0
Stop 490015719S skipped, same as previous in 366/outbound/0
Stop 490011630S2 skipped, same as previous in 366/outbound/0
Stop 490011630S2 skipped, same as previous in 366/outbound/1
Stop 490004992E skipped, same as previous in 497/inbound/0
Stop 490000500Y skipped, same as previous in b13/inbound/0

1 Like