1

I don't know how to summarize it in just one title, but here is the problem:

My goal is to calculate the travel time from residential points to stores via public transit. Basically this period of time consists three parts:

  1. The walking time from a residential point to the nearest bus stop "t1", which can be calculated by the Nearest Facility tool from Network Analyst. The resulting table is called "Resident_Stop", of which the number of records is m;

  2. The bus-riding time "t2" from this bus stop to the nearest bus stop of the target store via bus route, which is a record from Network Analyst's OD Time Matrix table, namely, "Stop_Stop". The origins and destinations are all bus stops on one single bus route so that the number of records is s*s;

  3. The walking time from the ending bus stop to the store "t3", which is basically the same with the first step. The table is "Stop_Store", of which the number of records is n.

So the total travel time "t" equals to (t1+t2+t3) and here is where problem occurs: I haven't figured out a way to attach the three tables reasonably to add the times on using a join. Currently I have an OD Time Matrix table of the walking time directly from residential points to stores via road network (no transit involved) and its number of records is m*n. I also separatly joined the table "Resident_Stop" in step 1 and the table "Stop_Store" in step 3 to the m*n-sized table based on residential point IDs and store IDs. So the remaining thing now is to assign the bus-riding time in table 2 based on table 1's stop IDs and table 3's stop IDs to each of the m*n records. Then I can get the total time.

Should you get any ideas, I'm willing to discuss with you. I'm now thinking about using Python to handle this but I'm a beginner on that. If you have any books or tutorials to recommand please tell me.

  • This is a big job for a beginner. Perhaps break it down into steps rather than looking at it as one big problem. So you have no trouble calculating the individual times, is that right? – Michael Stimson Jul 29 '14 at 4:15
  • Yes, all the individual tables are ready. – PacmanKX Jul 29 '14 at 4:16
  • Is there a unique id between the 3 tables for each trip? – Michael Stimson Jul 29 '14 at 4:17
  • Yes. Between 1 and 2 it is the ID of the nearest stop from the residential point. Between 3 and 2 it is the ID of the nearest stop from the store. – PacmanKX Jul 29 '14 at 4:19
  • 1
    This looks a multi-modal network analysis but as Michael said it is too broad for one GIS SE question so we will need you to work through it in a series of focussed Q&As. – PolyGeo Jul 29 '14 at 5:47
1

I'll demonstrate my suggestion using 14 bus stops:

enter image description here

The trick here is to modify Stop_Stop matrix into shorter table:

enter image description here

The store is closest to stop 8, thus above table can be reduced to 14 rows by Create Feature Layer (Model builder) or changing Definition Query (script) to [From_Stop]=8. Similar thing has to be done with stops2store table, so it will contain only 1 row:

enter image description here

Start your journeys by joining house2stop, stop2stop and stop2store tables as shown below:

enter image description here

Add field Total to house2stop, and use field calculator to convert distance fields (last fields in above picture) to travel time. Example below shows distances only:

enter image description here

All this is doable using Model Builder and can be extended to the case with multiple stores, using store ID and 'Total' field name as parameters. It woul de nice though to let some of them just walk:) Note: it was tested on FGDB tables.

  • Thank you for your in-depth answers. But one thing is that I got multiple stores and there is a chance that more than 1 stores share 1 bus stop, so problem will occur when joining Stop_Stop and Stop_Store tables. Plus there is multiple bus routes. Another problem I just discovered is that when using OD Time Matrix tool to generate Stop_Stop table, I always get tables with number of records less than s*s. Do you know what may cause that? – PacmanKX Jul 31 '14 at 20:54
  • Multiple routes is not an issue, it just make your stop_stop table longer. I hope you are not going to save travel to multiple stores in 1 field. If we can agree on this, the number of target stores is not an issue, travel times to N stores simply have to be saved in N fields. You have to iterate through stores, making one at a time THE target. Period. Without seeing your network I cannot answer s*s question. – FelixIP Jul 31 '14 at 21:20
  • OK, I understand you. So for one bus route I can only process one store for all residential points with one operation, right? Unfortunately I got 297 stores and 30 bus routes and that's gonna be near 9,000 operations. Is there some methods to automate your process and iterate through stores automatically? – PacmanKX Aug 1 '14 at 2:58
  • No, you can process one store with many routes. Important thing is to figure out what are you trying to achieve. Travel time from every house to every 297 stores? Or maybe to find the store that is fastest to reach from any house. Both actually achievable with Model Builder, but first one will add 297 fields to your houses table. Python is much better solution in any case though – FelixIP Aug 1 '14 at 4:07
  • Yes your table stop_stop must include all 30 routes, i.e. let them change the bus while shopping – FelixIP Aug 1 '14 at 4:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.