I’m importing RoadDisruption data (https://api.tfl.gov.uk/Road/all/Disruption) and came across a problem parsing the location field. Most of the times we get the data in the same format, like so:
“location”: “[A3036] Albert Embankment (SE1) (Lambeth)”,
Hi @fcovas
That is a very good question!
The disparity between the two sets of disruption data in /roads are not errors as such but rather duplications. If you look at the IDs for the locations in your first list, they are pre-fixed with “TIMS”. These disruptions are entered into our TIMS traffic information system by the London Streets Traffic Control Centre at TfL. This is the official source of TfL’s traffic information. The IDs relating to the second list start with “TDM”. These are created by our Travel Demand Management Team and are used to create maps like the one on this page https://tfl.gov.uk/status-updates/major-works-and-events/baker-street-roadworks?cid=baker-street-roadworks (TDM-0038, duplicating TIMS-165573). The format of the TIMS feed did not suit their purposes so they wanted to add their own version of the disruptions. So we have a less than perfect situation in the API now unfortunately. As these disruptions are usually in the TIMS feed (I say usually because sometimes the TDM team start their comms before the LSTCC have accurate information to add to TIMS so there is a small chance they may include a future disruption earlier), you could easily filter to remove any disruptions that are tagged TDM. Hope this helps!
Apart from TMD and TIMMS data, are there any more sources that can have this issue? I can see that there are some events with the PWC prefix that don’t follow the TIMMS location format. Are these duplicates and can be ignored?
Hi again! Ah I didn’t realize there were still PWC items in there. These are planned works that were uploaded ahead of being entered into the TIMS system. Can you give me the ID so I can check the one you’ve found? I have a feeling that it’s a rogue one as I was told that this data set is no longer in use. Thank you!