Multiple Routes from Attribute Table inputs

1796
7
04-07-2021 12:02 PM
David_Gardiner
New Contributor II

I wanting to create and display multiple driving routes calculated from two sets of coordinates (Start & Stop) that exist from within the same attribute table. I suppose its much like a batch process, taking each set of coordinates, calculating the route distance, display and then move onto the coordinates in the next row until there are no rows left. I'm looking to have a mass of routes cobwebbed in the display so that I can analyze fro crossing patterns.

Can this be done somehow please?

0 Kudos
7 Replies
Robert_LeClair
Esri Notable Contributor

I think what you're looking to accomplish is Hierarchy in network analysis that can be accomplished using the Network Analyst extension.

If you're new to Network Analyst, there are quite a few free tutorials here where you can learn about workflow in the extension.

0 Kudos
DavidPike
MVP Frequent Contributor

In your stops you can assign a routeName attribute to do this 

see the explanation in the Stops parameter - Find Routes (Ready To Use)—ArcGIS Pro | Documentation

a freindlier explanation - Route analysis layer—ArcGIS Pro | Documentation

 

routeName

This represents the name of the route to which the stop belongs. Stops with the same RouteName value are grouped together.

Using this field, you can group stops into different routes, and the output attempts to generate one route for each group of stops.

If some stops have route names, they are grouped into a route with the same name. If some stops have RouteName values and others do not, those without route names are listed as unassigned in the results and are left out of the solution.
If none of the stops have a RouteName value, all the stops belong to the same route and one route is generated.

 

0 Kudos
David_Gardiner
New Contributor II

Hi David

Thank you so much for your help. Are you able to add further please?

Is this a Tool that can be run or is it run by code?

I have attached an excel file that shows the attributes assigned to a feature. How do I structure Route Analysis Layer functionality to see Field = ObjectID as the RouteName and it has a Stop at Fields = Reside x and Reside y and a second stop at Field = x and y. Then how do I run the functionality as a batch that processes down the ObjectID column in the attribute table?

Hope you can help me.

Kind regards

Dave

0 Kudos
DavidPike
MVP Frequent Contributor

Well you'd first need to create a feature class from your spreadsheet using the Latitude and Longitude values.
Create points from a table—ArcGIS Pro | Documentation

You've also mentioned Reside fields which I cant see in the XLS. This is pretty confusing.

If you used objectID as RouteName you'd only have one stop per route surely which wouldn't make any sense.

 

0 Kudos
David_Gardiner
New Contributor II

My fault, I dragged in the wrong file. Try this one with 1 set of coords Reside x&y and the second coords x&y.

0 Kudos
DavidPike
MVP Frequent Contributor

I kind-of get it, reside would be a single origin stop, then the other xy field would be the final destination stop? i.e. 2 points per route.

Any Stop location for the Routing tool is derived from the geometry of each row/feature in the feature class rather than an xy field or fields. 

The way your data is structured makes this slightly more difficult as the csv would have to be manipulated to have a row of origin stop with route ID 1, and another row for destination stop with route ID 1.

It's fairly easy with python but considering the very small number of routes you have, it can be done manually pretty fast.  Do this manipulation in the CSV then re-add as table to xy via the single lat long entries.

MelindaMorang
Esri Regular Contributor

Hello David and anyone else reading this thread who might be doing similar workflows.

Esri’s Network Analyst Team is doing some research about customer workflows involving solving routes or calculating travel times and distances between known or preassigned pairs of origins and destinations.  It sounds like that's what you're doing here!  We’d like to better understand our customers’ needs in this area and may use this information to design and develop improved tools and workflows.

If you have a few minutes and are willing, could you please fill out the attached survey and return it to the e-mail address included inside the document?  Alternatively, you can reach out to me (my e-mail address is in the document) to set up a meeting.

Thank you so much!!

0 Kudos