Calculate travel distance between each point

980
13
05-23-2022 02:53 PM
tutu
by
New Contributor

Hi,

I have two point layers, origination, and the destination. I want to calculate the travel distance and time between each origin and destination point. For example, here is the dataset:

Origin             Destination 

1                            X

2                            Y

3

And eventually, there will be 6 routes, 1X, 2X, 3X, 1Y, 2Y and 3Y. How should I do that in the network analysis or in ArcGIS?

0 Kudos
13 Replies
JaySandhu
Esri Regular Contributor

Use the OD Cost Matrix Analysis. You can load your Origins and Destinations and it will solve all N by M routes and return the travel distance/cost. You can look at the tutorial here:

Calculate the travel time between origins and destinations with OD Cost Matrix—ArcGIS Pro | Document...

Jay Sandhu

0 Kudos
tutu
by
New Contributor

Thank you Jay, the OD cost matrix is calculating every possible route.

I have one further question, unlike what I used to see in Network Analysis, the routes from the OD cost matrix are straight lines but not the drive paths. Am I doing it wrong? 

0 Kudos
KateDoughty1
New Contributor III

I think you should be able to use Network Analyst and have multiple destinations/origins. Both inputs need to have a field to join by in order for it to evaluate all routes possible. I did this in AGOL as well.

0 Kudos
JaySandhu
Esri Regular Contributor

The OD Cost Matrix does not return the shape of the path travelled. This is because it can take longer to compute for very large values of Origins and Destinations. The OD solver is designed for the case when you only need the shortest travel distance/cost and not the route geometry. Straight lines are returned between each origin/destination pair for convenience to identify the pair.

If you also want to get the actual route geometry then use the Closest Facility Solver. Load your origins as Incidents and your Destinations as Facilities. Set the CF solver to solve for the number of Destinations/Facilities that you have. When you solve this CF layer you will also get the paths travelled.

Jay Sandhu

0 Kudos
CNDC_OPAOperational_Performanc
New Contributor

I have a fairly large set of Origins and Destinations and am working on ways to improve the run times in python? Any suggestions?

0 Kudos
MelindaMorang
Esri Regular Contributor

This GitHub repo may be helpful to you: https://github.com/Esri/large-network-analysis-tools.  You might be able to use the tools provided there out of the box.  If you need to update or write code yourself, this DevSummit presentation may be helpful: https://mediaspace.esri.com/media/t/1_hzppnv8p 

0 Kudos
CNDC_OPAOperational_Performanc
New Contributor

By chance is there anywhere I can find an example where this was used on a large number of Origins and Destinations just to find the Drive Time and Distance.  I did really enjoyed the videos, but am still a bit unsure of how to actually apply the methods.

0 Kudos
MelindaMorang
Esri Regular Contributor

You should just be able to download the toolbox from https://github.com/Esri/large-network-analysis-tools and use it as is, I think.

0 Kudos
CNDC_OPAOperational_Performanc
New Contributor
I am trying, but having trouble figuring out what needs to be in the arguments? I am not arcpy power users by any means. I basically have two data frames for origins and destinations and want to create a drive time and distance table for each origin within 240 miles. Then I take the output and load it into a database.
0 Kudos