I am conducting a project about rail accessibility/capacity, working with railways/stations downloaded in R with Overpass.
Manually I computed the number of trains for each lines and I would like to assign this values to specific segment of the SpatialLinesDataFrame.
For Instance, Zagreb-Osijek 20 trains, I want the line passing through this two stations to have 20 as value.
Obviously I don't want to create a new line, but to use the existing railway.
The problem is that the lines representing the railways have different starting and ending points from the station nodes.
Any suggestions to perform this process?
I thought that merging all the lines in one feature could help.
railways_merged <- gLineMerge(railways)
In this way I have only one feature, and I guess that I need to re-split them according to points (stations).