Hello guys,
I have a problem that might be less straightforward, but please bear with me.
I have a polyline shapefile that contains all the bus routes (each bus route has an id, like 111, 120), and a point shape file that contains all the bus stops (each stop has an id, like 30102, 5061, and lat and long for each point).
Based on these two files, my goal is to generate a table that sequence stops (marked as 1, 2, 3...) for all the bus routes based on the sequence the stops are passed through. The attached file gives an example of such a table.
I have a logic to do this:
(1) Find the stops for all the bus routes based on spatial relationship (for example, intersecting);
(2) Calculate the network spatial weights for the stops on each route (it is a gis tool called 'generate spatial network weights', the resulting spatial weights are between 0-1, the larger the value the closer the two points are and vice versa);
(3) Identify the first stop (origin) for each route and mark them as 1st stop;
(4) Re-sequence the stops based on the spatial weight (for example, find the next stop closest to the first stop and mark it 2nd stop, and continue this process till there's no more stops left).
I can do the first three steps using the tools of gis. The problem is the final step: I cannot do it manually since there are over 10,000 bus stops and over 900 bus routes. So my question is that is there any scripts or any other tools to automate this process to generate the table I want? Of course you don't have to follow my logic. The sole direction is to generate the attached table for all the routes.
I'm very desparate to find a solution so please don't hesitate with any suggestions.
Many thanks!
Sui Tao
I have a problem that might be less straightforward, but please bear with me.
I have a polyline shapefile that contains all the bus routes (each bus route has an id, like 111, 120), and a point shape file that contains all the bus stops (each stop has an id, like 30102, 5061, and lat and long for each point).
Based on these two files, my goal is to generate a table that sequence stops (marked as 1, 2, 3...) for all the bus routes based on the sequence the stops are passed through. The attached file gives an example of such a table.
I have a logic to do this:
(1) Find the stops for all the bus routes based on spatial relationship (for example, intersecting);
(2) Calculate the network spatial weights for the stops on each route (it is a gis tool called 'generate spatial network weights', the resulting spatial weights are between 0-1, the larger the value the closer the two points are and vice versa);
(3) Identify the first stop (origin) for each route and mark them as 1st stop;
(4) Re-sequence the stops based on the spatial weight (for example, find the next stop closest to the first stop and mark it 2nd stop, and continue this process till there's no more stops left).
I can do the first three steps using the tools of gis. The problem is the final step: I cannot do it manually since there are over 10,000 bus stops and over 900 bus routes. So my question is that is there any scripts or any other tools to automate this process to generate the table I want? Of course you don't have to follow my logic. The sole direction is to generate the attached table for all the routes.
I'm very desparate to find a solution so please don't hesitate with any suggestions.
Many thanks!
Sui Tao