ONSdigital / SDG_11.2.1

Analysis for the UN Sustainable Development Goal 11.2.1
https://onsdigital.github.io/SDG_11.2.1/
Apache License 2.0
5 stars 7 forks source link

Research NI bus and train timetable data #398

Closed nkshaw23 closed 1 year ago

nkshaw23 commented 1 year ago

Locate data, check formats, create rough plan for downloading and extracting

nkshaw23 commented 1 year ago

The Translink Group comprises three main operating companies Ulsterbus, Citybus (trading as Metro and Glider) and Northern Ireland Railways. As far as I can tell data for these three companies should cover all public transport routes in NI.

Citybus (Metro and Glider) Ulsterbus NI railways

Datasets come in ATCO.CIF format (so hopefully we can use some of the code for GB train timetable extraction) and look to be updated fairly regularly. URLs change, so we cant scrap this page for updates but will have to store a hard copy of a certain download like we do for GB.

nkshaw23 commented 1 year ago

Citybus (Metro and Glider)

Data comes separately for Metro and Glider. We will pick the latest data and save as a hard copy

image

Data specification is linked. A sample of the data is below:

image

This consists of rows of data beginning with a two character prefix - the ones below are the ones we are likely to use. As per GB timetable, we will state some assumptions to limit the complexity of reading in the data:

QS bus journey header (includes date of operation and running days, and whether New, Delete or Revise) For each bus journey header: QO Origin (includes origin location code and time of departure) QI Intermediate (includes location code and time of arrival / departure) QT Destination (includes location code and time of arrival)

At the end of the dataset: QB Bus location additional information (provides easting and northing of bus stop based on location code in QO/QI/QT)

image

nkshaw23 commented 1 year ago

Ulsterbus

Use the same CIF format as above which is good, but there is a seperate CIF file for each service unfortunately

image

nkshaw23 commented 1 year ago

NI Railways

The data specification doesnt work for me (just downloads some xml - maybe im missing something?). The data is in a different CIF format to the bus timetables above.

image

I think it might be .mca like the train timetable data for GB for which we use the following process

image

There are 2 lookups available on the website (.xls) which seem to contain the easting and northing for rail stations (designated by two characters in the CIF file)