RoadDisruption location format

Hello,

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)”,
  • “location”: “[A23] Westminster Bridge Road (SE1) (Lambeth)”,
  • “location”: “[A404] High Street Harlesden (NW10) (Brent)”,
  • “location”: “[A2216] Lordship Lane (SE22) (Southwark)”

But sometimes we get something different:

  • “location”: “Westminster City Council scheme to turn Gloucester Place and Baker Street to two way working”,
  • “location”: “Wandsworth Gyratory”,
  • “location”: “Gas main replacement works along Brixton Road”,

Am I right in assuming that the fixed format for the location is the correct form and that the other ones are errors in the data?

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!

Hi,

I didn’t notice the difference on the references. Thanks!

Cheers,

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?

Thanks

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!

There are currently three of those in the feed:

  • /Road/All/Disruption/PWC-0045
  • /Road/All/Disruption/PWC-0046
  • /Road/All/Disruption/PWC-0025

Thanks! Will take a look at those and get back to you after Easter.