Overlapping Bus routs

11719
22
Jump to solution
05-22-2013 11:07 PM
MohamedDarwish
New Contributor
I have three feature classes for the network:  
- Bus routes : having all bus routs split on each bus stop
- Bus stops : all bus stops location snapped to the ends of each bus route segment
- Walking routs : line connection between each two stations (face to face stations) to allow the passenger to cross the other side of street to change his direction using another bus.

the problem is the overlapped bus segments , Consider bus 66 and 19 are overlapping

[ATTACH=CONFIG]24608[/ATTACH]

like the attached image , if i'm solving the network to go from station 1 to station 3, if the solution started with bus number 66 it should continue with bus number 66 after station number 2 , but in some cases the route changes to another bus number however the same number 66 does exists in the second segment.

it should be bus number 66 and continue on 66 OR Bus 19 then continue bus 19 NOT bus 66 then bus 19
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JeremiahNieves
New Contributor III
There is actually a way to do what the original poster is describing. I recently created a network that solved this problem by creating a three dimensional multimodal network. An unpublished masters paper helped guide me (http://www.itc.nl/library/papers_2012/msc/upm/mahrous.pdf), but it's connectivity rules can be optimized greatly and in the end I only had . Attached is a screenshot I captured of my network which I edited in illustrator for some quick color and labeling.
[ATTACH=CONFIG]24913[/ATTACH]


Overview
What you have to do is to give each bus route a Z value that corresponds to it's bus route number (e.g. Bus Route 25 is 25 m above street level, which is 0m). This ensures that while the bus routes are in the same connectivity group, they will never intersect. You must also create a polyline features, "connectors" whose endpoints correspond with the bus stops, which are at 0m and spatially coincident to the street (walking network), and the bus route. To make sure that these connectors do not cross over each other, giving you the problem you now have,  I messed with the geometry, in Python, of the pre-made bus network I was using to offset every route 5 meters to the East.  This gives you connectors that radiate from a single bus stop to every route serviced at that location, thus modeling bus stops that service multiple routes. These connectors in themselves do not add to the total travel cost if you do not want them to. I was measuring cost in minutes and used these connectors to have a route specific, one-way cost of "waiting at the bus stop" when going from the street to the route. Since time used egressing a bus is negligible, I had the time cost as zero when the agent moved from the route to the street.

If you have a large network, as I did with 25 routes and over 9750 stops, knowledge of Python and how to modify the geometry of created features is needed for this to be feasible time wise. Doing this by hand would take a horribly long time. I would say that once all the attribute fields were set and ready it took me about 5 hours worth of scripting and debugging to get the final network components (one file for 3D connectors, 3D routes, 3D streets, and 3D stops). From there I just created the network data set in Arc Catalog.

An important note: When solving a network layer, you must choose the option to display the routes as straight lines. For whatever reason the analysis failed when ArcMap tried to display the individual routes on the path they took. My guess is an issue with the  three dimensionality of the network.

Feel free to contact me with any questions or any issues with implementing Python in such an endeavor!

Jeremiah

View solution in original post

0 Kudos
22 Replies
MelindaMorang
Esri Regular Contributor
Unfortunately, there is not really a way to do what you are trying to do.  This is a difficult problem.

As long as the impedance on both bus routes is exactly the same, the Network Analyst Route solver will somewhat arbitrarily choose which one to take.  We see this sometimes in cases where there are overlapping roads or loop-shaped roads where you could go either way around the loop.  However, if the impedances are exactly the same and the route segments are going to the exact same place, then the route generated will end up in the same place and show the same travel time, so the results will be "correct".  Unfortunately, if you are trying to generate directions, then you will see a difference in which bus it says to take.

I wish I had a better answer.
0 Kudos
PatrickStevens
Esri Contributor
One way to think of this problem is to imagine why wouldn't someone just swap buses in real life. If a person's goal is to get from station 1 to station 3 as quickly as possible, and it is faster for the person to get off of bus 66 at station 2 and get on bus 19, then they should swap buses.

One reason might be that bus 19 won't be sitting there waiting for them at station 2 when they get off of bus 66.  To model arrive and depart times using network analyst, you will need to use a custom evaluator, as we don't support transit times out-of-the-box.  Using custom evaluators gives you great flexibility, but requires higher maintenance as well as some programming knowledge.

I think another reason they don't swap buses is the time it takes to get off of one bus and get onto another.  This could be modeled by using cost delays.  You could digitize a turn in at station 2 that would penalize a switch from bus line 66 to bus line 19. Or instead of connecting both bus lines directly to station two, have a small edge run from each bus line to the station that provides a cost of departing and/or getting on a bus.  Either of those solutions would discourage switching by making it take time to switch buses.
0 Kudos
JeremiahNieves
New Contributor III
There is actually a way to do what the original poster is describing. I recently created a network that solved this problem by creating a three dimensional multimodal network. An unpublished masters paper helped guide me (http://www.itc.nl/library/papers_2012/msc/upm/mahrous.pdf), but it's connectivity rules can be optimized greatly and in the end I only had . Attached is a screenshot I captured of my network which I edited in illustrator for some quick color and labeling.
[ATTACH=CONFIG]24913[/ATTACH]


Overview
What you have to do is to give each bus route a Z value that corresponds to it's bus route number (e.g. Bus Route 25 is 25 m above street level, which is 0m). This ensures that while the bus routes are in the same connectivity group, they will never intersect. You must also create a polyline features, "connectors" whose endpoints correspond with the bus stops, which are at 0m and spatially coincident to the street (walking network), and the bus route. To make sure that these connectors do not cross over each other, giving you the problem you now have,  I messed with the geometry, in Python, of the pre-made bus network I was using to offset every route 5 meters to the East.  This gives you connectors that radiate from a single bus stop to every route serviced at that location, thus modeling bus stops that service multiple routes. These connectors in themselves do not add to the total travel cost if you do not want them to. I was measuring cost in minutes and used these connectors to have a route specific, one-way cost of "waiting at the bus stop" when going from the street to the route. Since time used egressing a bus is negligible, I had the time cost as zero when the agent moved from the route to the street.

If you have a large network, as I did with 25 routes and over 9750 stops, knowledge of Python and how to modify the geometry of created features is needed for this to be feasible time wise. Doing this by hand would take a horribly long time. I would say that once all the attribute fields were set and ready it took me about 5 hours worth of scripting and debugging to get the final network components (one file for 3D connectors, 3D routes, 3D streets, and 3D stops). From there I just created the network data set in Arc Catalog.

An important note: When solving a network layer, you must choose the option to display the routes as straight lines. For whatever reason the analysis failed when ArcMap tried to display the individual routes on the path they took. My guess is an issue with the  three dimensionality of the network.

Feel free to contact me with any questions or any issues with implementing Python in such an endeavor!

Jeremiah
0 Kudos
MohamedDarwish
New Contributor
Thank U Jeremiah Nieves for your great post , i really appreciate that
also the research link was really helpful

could you please provide your python code or which tools to create the connector feature class automatically as i have more than 70 route with 1500 bus station
0 Kudos
JeremiahNieves
New Contributor III
Thank U Jeremiah Nieves for your great post , i really appreciate that
also the research link was really helpful

could you please provide your python code or which tools to create the connector feature class automatically as i have more than 70 route with 1500 bus station


You're quite welcome. Unfortunately, since I was teaching myself Network Analyst from the ground up last fall, I did not implement a Python script until I had created a number of the features by hand. In addition, the script was essentially a kludge, a quick and dirty (yet functional) fix that used paths specific to my files. However, I have provided the (ugly) code below as it may help. Please note that the code is written for ArcGIS 10.0.

I will go ahead and give an overview of creating a connector outside of Python, to the best of my recollection, as I assume it can be replicated in model builder, although I find implementing iterations much easier in Python. I am giving serious contemplation to making a summer project of creating a custom tool that will take necessary input features, with the proper attribute fields, and create the spatial framework for the network. This would only leave the user the task of adding of travel costs to the features.

Overview of Connector Construction

  • It is assumed that the bus routes have been offset at this point, but not turned into 3D features yet. Your bus stops must have unique IDs; this is critical to being able to construct connectors.

  • Take your original bus stop feature and create a duplicate bus stop feature which I will refer to as "pseudo stops." The bus stops should be turned into a 3D feature (Feature to 3D By Attribute) with a z value of '0.' Make sure to Snap these stops to whatever is serving as the pedestrian paths in the network.

  • The pseudo stops are a bit trickier.

  • [INDENT]
  • First, 'Snap' the pseudo stops to the nearest bus route. For this to work, your bus stop and bus route data should be accurate in their respective locations.

  • For each bus route, you are going to 'Select By Location' pseudo stops that intersect the given bus route, give each of those selected stops an ending elevation attribute equal to the given bus route's number, and export the selected pseudo stops as their own feature. I recommend putting the route number serviced somewhere in the name.

  • Once you have done this, you should have a feature of pseudo stops for each bus route. Give each of them an attribute that gives them a z value equal to that of the route served. Merge all of these features into one pseudo stop feature and use 'Feature to 3D By Attribute' using aforementioned z value of the route serviced.[/INDENT]

  • You should now have the set of real bus stops at z == 0 and the set of pseudo bus stops with z == route # serviced. In the end, this allows you to have single bus stops at ground level that service multiple routes.

  • Merge the two, psudeo and real, bus stop features.

  • Use the 'Points to Line Tool (Data Management)' to construct the connectors using the unique bus stop ID as the grouping field (meaning stop ID #23 creates a line between the real and pseudo stops with ID #23 and no others). This is in Line 113 of the code.


This, to the best of my 6 month old memory, will give you 3D connectors like you see in my previously posted picture. I'll work on a custom tool over the summer and update what I do or do not come up with. Below is the Python code in .py format.
0 Kudos
MohamedDarwish
New Contributor
Dear Jeremiah Nieves, you really made my day & i appreciate your support.
you have good skills for describing the solution.

HONESTLY, your answer is much better than ESRI specialists :D:D
Best Regards
0 Kudos
JeremiahNieves
New Contributor III
Any time! Feel free to contact me if you have any other questions pertaining to this.

To be fair, the Network Analyst and 3D Analyst extensions are massive in both size and power and one of the best things about ArcGIS is that users can combine aspects of multiple extensions to create solutions that not even ESRI may have anticipated. So while the specialists are indeed quite qualified specialists, they cannot always have an answer and that is where the collective experiences in the forums come into play.

Make sure to give your feedback on the documentation provided for Network Analyst or anything pertaining to ArcGIS as ESRI can only make improvements with feedback from users. I know that Ms. Morang, a specialist in this thread, assisted me by soliciting my thoughts last fall on Network Analyst in order for my suggestions to be heard.

Keep up the good work specialists!
0 Kudos
MelindaMorang
Esri Regular Contributor
Thanks for the kind words, Jeremiah.  I'm glad to see that you were able to come up with a really nice solution for your project!

We here at Esri are working to develop a much more advanced and useful set of tools for public transit analysis.  I am always interested in hearing from users working in this area to learn about their work, the types of analyses they want to perform, and the challenges they have with our current software.  Feel free to send me a private message if you want to talk further about public transit analyses.  You are also always welcome to contact me with complaints or suggestions about Network Analyst tools or documentation in general.

Thanks, and good luck with your transit projects!
0 Kudos
nicogis
MVP Frequent Contributor
In these days  I am developing a tool in c#/arcobjects for data GTFS ( General Transit Feed Specification ) to multimodal Network Dataset for Network Analyst.

for stop bus the idea is use a custom network evaluator kind this one to add a wait time : http://www.arcgis.com/home/item.html?id=72ef24542857413c8981f2e196f1bb13

When I finished work I notification in this thread

#Jeremiah: I have seen your pdf. Why for bus and stop haven't use subtype in connectivity? so you have 1 feature class bus and 1 feature class stop.
0 Kudos