Thanks for the info. As regards the H26, I feel that what you are seeing in TransXChange doesn’t quite match up with what’s happening in the API - TXC has 1 outbound (Hatton Cross-Central Parade) and 27 inbound (Central Parade to Hatton Cross) routes, whereas the API has 2 inbound and 2 outbound.
In the API, the two inbound routes are identical, but the outbound ones differ between Harlington Road West and Browells Lane (stop L), reflecting the long-term temporary diversion to the east of Feltham. Interestingly, /Line/Timetable/H26/outbound reflects only the original route, not the diverted one.
My suspicions are that all of the duplications arise from similar such diversions being entered somewhere in the system as additions rather than amendments
Hi All. I’ve had a look at the H26 schedule data and this looks to be a similar issue to that of the W8, I’ve corrected this now and should be in the next TxC upload.
@nickp I have a theory on the root cause of duplicated lines.
I am expecting the issue to occur with the 491 once we’ve built the data and that will confirm my theory.
@jamesevans
I wasn’t complaining about the delay in updating (well, not as such), rather that there was an update but it still retained the 13/2 timestamp. It was pure chance that I happened to spot the data had actually altered, as I usually rely on the timestamp to tell me when I need to apply your updates to my database.
note - I haven’t looked at all of these duplications in detail, but the W4 is definitely a case of adding the normal version of the line on top of the one with the temporary changes at Tottenham Hale, rather than replacing it
When you say the lines are duplicated, are you refering to multiple branches with the same ID appearing in the StopPointSequences? I’ve been pulling my hair out trying to understand why the DLR was showing the same branchIDs twice in each direction. And my code to figure out all the possible combinations of branches for southeastern crashed at about 65 million combination as it expects branchIds to be unique… If we’re suffering the same problem I shall reduce the amount of pulling out of hair that I’m doing…
Exactly so, here is what I got this time for the DLR :
LineId
Direction
ServiceType
BranchId
RouteDesc
dlr
inbound
Regular
0
Beckton DLR Station - Canning Town DLR Station
dlr
inbound
Regular
1
Woolwich Arsenal DLR Station - Canning Town DLR Station
dlr
inbound
Regular
2
Lewisham DLR Station - West India Quay DLR Station
dlr
inbound
Regular
3
Canning Town DLR Station - Poplar DLR Station
dlr
inbound
Regular
4
Canning Town DLR Station - Stratford DLR Station
dlr
inbound
Regular
5
Poplar DLR Station - Westferry DLR Station
dlr
inbound
Regular
6
Poplar DLR Station - Stratford DLR Station
dlr
inbound
Regular
7
Shadwell DLR Station - Tower Gateway DLR Station
dlr
inbound
Regular
8
Shadwell DLR Station - Bank DLR Station
dlr
inbound
Regular
9
West India Quay DLR Station - Westferry DLR Station
dlr
inbound
Regular
10
West India Quay DLR Station - Poplar DLR Station
dlr
inbound
Regular
11
Westferry DLR Station - Shadwell DLR Station
dlr
inbound
Regular
12
Stratford DLR Station - Stratford International DLR Station
dlr
inbound
Regular
100
Beckton DLR Station - Canning Town DLR Station
dlr
inbound
Regular
101
Woolwich Arsenal DLR Station - Canning Town DLR Station
dlr
inbound
Regular
102
Lewisham DLR Station - West India Quay DLR Station
dlr
inbound
Regular
103
Canning Town DLR Station - Poplar DLR Station
dlr
inbound
Regular
104
Canning Town DLR Station - Stratford DLR Station
dlr
inbound
Regular
105
Poplar DLR Station - Westferry DLR Station
dlr
inbound
Regular
106
Poplar DLR Station - Stratford DLR Station
dlr
inbound
Regular
107
Shadwell DLR Station - Tower Gateway DLR Station
dlr
inbound
Regular
108
Shadwell DLR Station - Bank DLR Station
dlr
inbound
Regular
109
West India Quay DLR Station - Westferry DLR Station
dlr
inbound
Regular
110
West India Quay DLR Station - Poplar DLR Station
dlr
inbound
Regular
111
Westferry DLR Station - Shadwell DLR Station
dlr
inbound
Regular
112
Stratford DLR Station - Stratford International DLR Station
dlr
outbound
Regular
13
Tower Gateway DLR Station - Shadwell DLR Station
dlr
outbound
Regular
14
Bank DLR Station - Shadwell DLR Station
dlr
outbound
Regular
15
Stratford DLR Station - Poplar DLR Station
dlr
outbound
Regular
16
Stratford International DLR Station - Stratford DLR Station
dlr
outbound
Regular
17
Westferry DLR Station - Poplar DLR Station
dlr
outbound
Regular
18
Westferry DLR Station - Canary Wharf DLR Station
dlr
outbound
Regular
19
Poplar DLR Station - Canning Town DLR Station
dlr
outbound
Regular
20
Poplar DLR Station - Canary Wharf DLR Station
dlr
outbound
Regular
21
Canning Town DLR Station - Beckton DLR Station
dlr
outbound
Regular
22
Canning Town DLR Station - Woolwich Arsenal DLR Station
dlr
outbound
Regular
23
Stratford DLR Station - Canning Town DLR Station
dlr
outbound
Regular
24
Shadwell DLR Station - Westferry DLR Station
dlr
outbound
Regular
25
Canary Wharf DLR Station - Lewisham DLR Station
dlr
outbound
Regular
113
Tower Gateway DLR Station - Shadwell DLR Station
dlr
outbound
Regular
114
Bank DLR Station - Shadwell DLR Station
dlr
outbound
Regular
115
Stratford DLR Station - Poplar DLR Station
dlr
outbound
Regular
116
Stratford International DLR Station - Stratford DLR Station
dlr
outbound
Regular
117
Westferry DLR Station - Poplar DLR Station
dlr
outbound
Regular
118
Westferry DLR Station - Canary Wharf DLR Station
dlr
outbound
Regular
119
Poplar DLR Station - Canning Town DLR Station
dlr
outbound
Regular
120
Poplar DLR Station - Canary Wharf DLR Station
dlr
outbound
Regular
121
Canning Town DLR Station - Beckton DLR Station
dlr
outbound
Regular
122
Canning Town DLR Station - Woolwich Arsenal DLR Station
dlr
outbound
Regular
123
Stratford DLR Station - Canning Town DLR Station
dlr
outbound
Regular
124
Shadwell DLR Station - Westferry DLR Station
dlr
outbound
Regular
125
Canary Wharf DLR Station - Lewisham DLR Station
The number >= 100 are the duplicates with my own addition of 100 to ensure uniqueness
As far as the national rail side is concerned, don’t go there, it’s currently (for nearly 3 years) a disaster zone, both in terms of duplication and incompleteness - see this thread
Here’s the (relatively simple) case of Great Northern as an example, again the higher numbers are my own renumbering
LineId
Direction
ServiceType
BranchId
RouteDesc
great-northern
inbound
Regular
0
Kings Lynn Rail Station - Cambridge Rail Station
great-northern
inbound
Regular
100
Stevenage Rail Station - Finsbury Park Rail Station
great-northern
inbound
Regular
101
Finsbury Park Rail Station - London King’s Cross Rail Station
great-northern
inbound
Regular
102
Finsbury Park Rail Station - Moorgate Rail Station
great-northern
inbound
Regular
200
Peterborough Rail Station - Hitchin Rail Station
great-northern
inbound
Regular
201
Kings Lynn Rail Station - Hitchin Rail Station
great-northern
inbound
Regular
202
Hitchin Rail Station - London King’s Cross Rail Station
great-northern
inbound
Regular
300
Kings Lynn Rail Station - Finsbury Park Rail Station
great-northern
inbound
Regular
301
Finsbury Park Rail Station - London King’s Cross Rail Station
great-northern
inbound
Regular
302
Finsbury Park Rail Station - Moorgate Rail Station
great-northern
outbound
Regular
1
Cambridge Rail Station - Kings Lynn Rail Station
great-northern
outbound
Regular
103
London King’s Cross Rail Station - Finsbury Park Rail Station
great-northern
outbound
Regular
104
Moorgate Rail Station - Finsbury Park Rail Station
great-northern
outbound
Regular
105
Finsbury Park Rail Station - Royston Rail Station
great-northern
outbound
Regular
203
London King’s Cross Rail Station - Hitchin Rail Station
great-northern
outbound
Regular
204
Hitchin Rail Station - Peterborough Rail Station
great-northern
outbound
Regular
205
Hitchin Rail Station - Cambridge Rail Station
great-northern
outbound
Regular
303
London King’s Cross Rail Station - Finsbury Park Rail Station
great-northern
outbound
Regular
304
Moorgate Rail Station - Finsbury Park Rail Station
great-northern
outbound
Regular
305
Finsbury Park Rail Station - Kings Lynn Rail Station
How do you resolve these kinds of situations? I note you’ve been manually renumbering branches. Is it safe to simply delete one of the duplicates as appropriate until each BranchID per direction appears once?
Trust me, I’m not doing any manual renumbering (the northern-rail disaster goes up into the 5000’s - i.e 50+ sets of duplicates). My download routines detect duplicates and attempt to group them into self-consistent complete sets. This is what the examples I inserted before are taken from. The task is complicated by missing sub-routes and dangling cross-references.
By renumbering this way, I can keep and analyse all the duplicates and other problems, hence the regular posts here.
I would not recommend what you suggest, effectively picking one of each branchId at random, as you may end up with a non-self-consistent set. That said, it will work most of the time for bus, dlr, tram & tube, but not rail or river.
Separately I access the National Rail timetable data (data.atoc.org) and generate decent routing data from that for the rail side, as the Tfl version of this (including the Overground and Tflrail) is rubbish.
I also use /Line/Timetable to generate a second routing set, using the same route-building algorithms as for the National Rail data. This fixes, for me, most of the errors that I mentioned in the other thread (excluding national rail, which is, effectively, missing)