Select to view content in your preferred language

Bus lines from route analysis with public transit data

2151
8
Jump to solution
12-14-2021 05:29 AM
phunky
by
New Contributor

Hi there, I followed the tutorial to create a NDS from a GTFS-Source. If I now solve a routing problem through a route analysis layer it shows me the route and gives me information about the time it took etc. Is there a way to  show me which Bus lines were taken?

In another post there was a question on the direction functionality which is as I understand it not currently supported for transit data. But is that the only way to acquire that information?

Any help would be welcome, thanks!

0 Kudos
1 Solution

Accepted Solutions
MelindaMorang
Esri Regular Contributor

Sorry for the delay in response. I've been on vacation.

I'm glad Copy Traversed Source Features was helpful. It is indeed a neat little tool.

Regarding your questions, no, there is no way to change either behavior.

For 1, I think it helps to understand what the solver does. The solver simply seeks to find the optimal, or shortest, travel time from the origin to the destination. It does not know about any additional parameters about rider preference, etc. So if the fastest travel time between A and B can be achieved by taking an early bus, waiting a while, then taking a train, this is what the solver will return.  If the other option has the exact same travel time, I think it will still take the earlier bus just due to simple tie-breaking behavior. Essentially the graph search algorithm doesn't know what's going to happen later in the route when it's choosing which transit trip will get used along a transit line. It sees the transit line, figures out which trip minimizes the travel time along that segment, and uses it. For your case, perhaps if you use a slightly later overall start time for your route, it will give you the journey you want. Or, if you are trying to model an arrive time, you can use the Closest Facility solver with a single incident and facility, and it will let you use an arrive time (Route does not).

For 2, this is correct. The wait time is wrapped up with the overall travel time along a transit line segment, and there is no way to separate them. This is a limitation of the internal architecture of Network Analyst. The code DOES know how much is wait time and how much is ride time, but there's no way to pass that information back out to the user, unfortunately.

View solution in original post

8 Replies
MelindaMorang
Esri Regular Contributor

The answer to this question is "sort of". It depends on what details are important to you.

You can use the Copy Traversed Source Features tool to get a list of the individual network elements (edges, junctions, and turns) that were used in the route. Bus LineVariantElement features and the time of day they were used will be included in these results. However, this will NOT give you the specific trip_id and other details about which bus was actually used. There is, unfortunately, no way to access that information.

What are you trying to do? Perhaps we can brainstorm another way to achieve it.

0 Kudos
KatharinaPedri
Emerging Contributor

Hi Melinda!

I tested the tool myself just now with a routelayer that uses public transit data and is based on a specific time and date but I don't think I understand where I can see which time of the day was used per respective LineVariantElement. The reason I am trying to understand how the route is solved is because I believe it to choose a very weird public transit connection, and even completly wrong connections that don't even exist that time of the day. 

0 Kudos
MelindaMorang
Esri Regular Contributor

Hi Katharina.  To get any transit-specific information, you have to download a special tool from ArcGIS.com or GitHub that extends to core functionality of Copy Traversed Source Features to add the transit information, which is not included in the output of the core tool in ArcGIS Pro.  (This download includes several tools; the new one is called Copy Traversed Source Features With Transit.)  You can find more information about this downloadable tool in the user's guide.  The RunDepTime and RunArrTime fields have the departure and arrival times for the LineVariantElement.

0 Kudos
KatharinaPedri
Emerging Contributor

Hi Melinda! Thanks for your answer 🙂 Then I know! I thought one could see the times already in the "normal" tool. 

0 Kudos
phunky
by
New Contributor

Thanks for the quick reply! Ultimately the goal is to create an OD-cost Matrix. I was just searching for a way to understand the results and was using the routing for that. The tool you recommended is very helpful doing that! 

When reviewing some results, I stumbled upon two oddities:

  1. There is some unusual behavior in the way the routing takes place. For an example route, the fastest way is taking a bus to a train station and then going by train. The bus is taken the first chance there is instead of having a start waiting time and taking a connection to the train station minimizing the wait time at the station. Is there a way to change the routing behavior?
  2. The wait time is not listed as a separate field and not as a separate part of the route. Instead it is part of train trip. Is there a way to change that?

phunky_0-1639667246921.png

0 Kudos
MelindaMorang
Esri Regular Contributor

Sorry for the delay in response. I've been on vacation.

I'm glad Copy Traversed Source Features was helpful. It is indeed a neat little tool.

Regarding your questions, no, there is no way to change either behavior.

For 1, I think it helps to understand what the solver does. The solver simply seeks to find the optimal, or shortest, travel time from the origin to the destination. It does not know about any additional parameters about rider preference, etc. So if the fastest travel time between A and B can be achieved by taking an early bus, waiting a while, then taking a train, this is what the solver will return.  If the other option has the exact same travel time, I think it will still take the earlier bus just due to simple tie-breaking behavior. Essentially the graph search algorithm doesn't know what's going to happen later in the route when it's choosing which transit trip will get used along a transit line. It sees the transit line, figures out which trip minimizes the travel time along that segment, and uses it. For your case, perhaps if you use a slightly later overall start time for your route, it will give you the journey you want. Or, if you are trying to model an arrive time, you can use the Closest Facility solver with a single incident and facility, and it will let you use an arrive time (Route does not).

For 2, this is correct. The wait time is wrapped up with the overall travel time along a transit line segment, and there is no way to separate them. This is a limitation of the internal architecture of Network Analyst. The code DOES know how much is wait time and how much is ride time, but there's no way to pass that information back out to the user, unfortunately.

MelindaMorang
Esri Regular Contributor

Hello again, @phunky.  I'm considering whether there is a way we can enhance the Copy Traversed Source Features tool in the future to include some more transit-specific information, such as some of the things you were suggesting.  This is just a research project at this point, but the first step is better understanding customer needs.

I believe you mentioned wanting to know the following things from your solved transit analysis:

  • Which bus line was used
  • Wait time
  • Ride time

Is that all the information you need, or is there other information that would be valuable to have?

Thanks for any information you can provide.

MelindaMorang
Esri Regular Contributor

Hello again.  Just wanted to follow up on this thread.  I have created a downloadable script tool that adds transit information to the output of Copy Traversed Source Features, including the Run ID, ride time, wait time, and transit trip arrival and departure time to each transit segment.

The tool runs a post-process that queries the Public Transit Data Model tables to make a good guess as to which transit runs were used for each segment based on the constraints of the analysis settings and the arrival and departure times for that segment.  This isn't a terribly efficient way to solve the problem, but it gets the job done.

Please consider this a prototype.  Definitely let me know if the tool doesn't return the output you want or if you experience any problems. I would like to get this behavior into the core software at some point, and feedback on this prototype will be very valuable in doing so. 

Download the tool from ArcGIS.com or GitHub.  (This download includes several tools; the new one is called Copy Traversed Source Features With Transit.)

0 Kudos