691
8
08-24-2017 10:03 AM
New Contributor III

Hello! I need to find the roadway distance between 4 separate locations. I'm familiar with Network Analyst and am using OD Cost Matrix. If i have  4 records, I need the distance between 1-2, then 2-3, then 3-4, then 4-1. Does this make sense? So I need to act like I'm driving those distances, starting at 1, then going to each record, then ending back up at 1. Does anyone know how to do this? Is OD Cost matrix the best way,o or is closest facility better? Thanks in advance!

8 Replies
MVP Alum

I suspect Route Analysis would be the best option:

Chris Donohue, GISP

New Contributor III

Yes, perfect! Thank you!

New Contributor III

Are you familiar with the tool? It only provides one distance, whereas I need 4 separate routes. Are you able to help me out? Thanks so much!

MVP Emeritus

what do you get with OD? worth a try since you have the data

New Contributor III

I just get distances from one point to all other points. I think my problem is the travelling salesman problem, but I only get one measurement instead of the distance from each location.

Esri Regular Contributor

Route analysis is the right approach. Create the route, add the four stops. Solve. The output route only has the overall length of the route. Open up the attribute table for the Stops. it will have a field that has the cumulative length to each stop. You will need to subtract from the previous row to get the partial lengths. And it does not have the length back to 1 unless you have added it as the last stop.

Best way is to solve four routes, 1 to 2, then 2 to 3, then 3 to 4, and 4 to 1 and get the distances from the route attribute table. All these four solves can be done in the same on route layer by specifying a common ROUTENAME to each pair of stops.

Jay Sandhu

New Contributor III

Ahhhh - that is super helpful! I was able to do it - thanks!

Related question, if you know the answer. I have 7 polygon buffers, which points inside each buffer that needs to use the route tool. So I don't want it to cross the buffer line, I want to use the route tool for inside each buffer, but can I run the route tool only one time? I tried using polygon barriers, but it seemed to think inside the polygon was a barrier. Does my wording make sense?

Esri Regular Contributor

You can convert the polygons to lines using the Feature To Line GP tool and then load them as line barriers. This will restrict the routes to be within that boundary.

Jay Sandhu