Hi, I'm trying to dynamically create the line drawings in a GTFS, that is, I want to create the shapes table, which is empty by default. I thought that it must be possible to do from the stop_times table, the stops table and the 'mother' lines in kml that contain the total theoretical route of each line. With stop_times I can know all the patterns that each line has (starts and ends) identified with stop code.


The spicy part starts here. I should cut the parent line by start and end, keep the correct segment - I don't know how to identify it - and reorient it in case the 0 vertex of the line doesn't match the stop coords origin The thing is, I don't quite know how to do it. Any help would be appreciated.
Thank you very much!
Pol
PD: I cannot attach KML on this thread. ‘Mother’ lines comes from there: