planarnetwork / dtd2mysql

MySQL / MariaDB import for DTD feeds (fares, timetable and routeing)
30 stars 10 forks source link

CR record in MCA file isn't handled #85

Closed miklcct closed 6 months ago

miklcct commented 6 months ago

A CR record in an MCA file indicates a change in the service property en-route, for example, from an EMU to a DMU. It isn't currently handled in the importer.

For example, the service L65563 changes its property two times en-route, including the addition of catering at Swansea, and the power switch at Cardiff. I am looking to rewrite this timetable website using MySQL as the backend to improve performance however it isn't currently possible.

linusnorton commented 6 months ago

I think we'd need to add an extra table for the change records. At the moment the information just goes into the schedule table.

miklcct commented 6 months ago

I am seeing how I can do that, but the problem is that the CR record needs to reference the stop_time ID of the next line in the CIF file, which isn't possible in the current parser, and for a more canonical model, the "changeable" property in the BS and BX records should also be extracted to the new table as well.

linusnorton commented 6 months ago

it could reference the previous one to indicate that "this change is applied after x stop", not as intuitive as it applying "on x stop" but might be viable

miklcct commented 6 months ago

The service property is a property for a section of route, so if applied "after x stop", it can be confusing.

The actual change happens when the train calls at the transition stop.

I think I may make another record type which is used to reference the "next line" of a foreign ID, instead of the previous line.