I am using arcpy.na.solve to find the best transit route using network converted from GTFS data. I need two cost attributes to be combined: public transit time and walk time. How should I set up the travel mode?
Here is what I use for public transit only (which works fine):
travel_mode = "Public transit time"
Hi Jane. What do you mean by you "need two cost attributes to be combined"?
If you created your network dataset using the template provided with the tutorial in the ArcGIS Pro documentation, then the "Public transit time" travel mode is already configured to calculate walk time along streets and transit time along transit lines. When you solve a network analysis problem (like a Route) using "Public transit time" as the travel mode, it finds the optimal solution by considering the time it takes to walk along streets and ride public transit. You don't need to configure anything specific.
Thanks for replying, Melinda. My analysis needs to separate the walking time and the transit time on train/bus. And due to the size of my data, I need to use Python command to do the Network Analysis instead of clicking on buttons on the menu.
When I tested the menu options (so that I can create my arcPy commend accordingly), I found that the output route file only provides values for "Total_PublicTransitTime" if I choose "Mode: Public trasnit time " in the "Travel Settings" banner in the Network Analysis. The output column "Total_walktime" will be "null". However, if I clicked on the blue
sum sign and check both "PublicTransitTime" and "WalkTime", the output file will give me the walk time I need. Is there anyway to include this option into the python command?
When you create your Route layer in python, use the accumulate_attributes parameter to accumulate the WalkTime attribute. Make Route Analysis Layer—ArcGIS Pro | ArcGIS Desktop
Keep in mind that the Total_PublicTransitTime will include the walking time, so to get the transit+wait time, subtract off the Total_WalkTime.