Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

UK rail timetable SQL Server database + CIF file loader

License

Notifications You must be signed in to change notification settings

Phils0/UkRailTimetableDatabase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THIS PROJECT IS NO LONGER MAINTAINED

UK Rail Timetable Database + loader

A SQL Server database schema to load a UK timetable into plus a .Net Core app to load the data. The loader reads a full CIF timetable file into the database

How do I load a CIF file?

The runLoader.ps1 script will create the schema (deleting any existing tables and data), load a timetable and then add some indices to the database.

It assumes its connecting to an existing local database using integrated security and the database is called Timetable. CreateTimetable.sql will create the physical database in the default location. CreateTimetableRdg.sql creates a separate database called TimetableRdg should you want to have both.

runLoader.ps1 and Loader/Timetable/appSettings.json need to be updated with any different connection details

  • runLoadFullNrodFile.bat shows how to call runloader.ps1 for a Network Rail cif file.
  • runLoadFullRdgFile.bat shows how to call runloader.ps1 for a RDG cif file.

Limitations

Currently the loader has assumptions that it is reading in a full CIF in the format supplied by National Rail Open Data (NROD) or RDG. In the RDG case it loads the CIF file plus the Master Station file.

There are assumptions built into the loader that imply loading daily deltas files is problematic (it generates Ids during load, would need to select out of the database). I don't intend to implement this functionality given a full file is available everyday from NROD.

Database Ids = cif file line number

Due to the way database Ids are generated it created a quite nice unintended consequence that the Id is actually the line number of the record in the cif file. There is no guarantee this will always be the case.

About

UK rail timetable SQL Server database + CIF file loader

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages