I'm usually closer to my answer than now, but I've looked at all the answers here and couldn't adapt one to work on my data and I'm stuck.
I have oriented polylines (Montreal's train network) and stops (train stations).
My network looks like this:
I'd like to split my tracks at each stations and ideally add fields FromStation, ToStation to my new Train tracks table.
I've used ST_Snap to snap my points to my tracks so there's an intersection. There's no guaranty though that there's a node where it intersects.
I tried some variation using ST_Split. No error, but no results either. Just empty geometry in the end. :(
My data comes from the gtfs, so for now, I have a shape_id, trip_headsign and route_short_name on each line.
If I could have a resulting table like
shape_id fromstation tostation 2_1 VRM1B SLR3B 2_1 SLR3B SLR2B 2_1 SLR2B SLR1B etc.
(shape_id 2_1 is the blue line west bound), that would be ideal.
I need somehow to use that to create a personnel allocation model for our inspectors and agents on the network. Each segments will be considered a road in Network Analyst with usage restriction to match the train schedule at each train station... Never found anything like that done, but I've been given the task to at least try ;)
Any help would be much appreciated.