Select to view content in your preferred language

Network distance between specific paired points by ID

5509
12
Jump to solution
05-10-2018 01:07 AM
KentaOkuyama
Occasional Contributor

Hello, 

I'm trying to figure out a better way to calculate network distance between origins (home) and destinations (office) based on ID. 

I want to get a commute distance for all subjects in my data (homeaddress point to workaddress point)

I'm using ArcGIS Pro 2.0.

I have 2 separate point datasets which are already geocoded:

Each data set has 2 columns

data_house = personID, homeaddress

data_office = personID, workaddress

I would like to get an output dataset which has  personID and distance from homeaddress to workaddress.

I thought it would be very easy in the beginning, but looks like there is no specific analysis tool to get distance by ID at once. I am using OD cost matrix tool, which produces an output with distance for all origin-destination points.

I can create my desired dataset by using "summary statistic tool" or "dissolve analysis" by ID, but I don't think it would be efficient once the data got big (ex. I do not really want to do OD cost matrix for 30000 x 30000 pair...).

If anyone has an idea I will greatly appreciate it.

0 Kudos
1 Solution

Accepted Solutions
MelindaMorang
Esri Regular Contributor

The way to do this is to use the Route tool instead of OD Cost Matrix.  First add your data_house layer to Stops, and use field mapping to map the personID field to the RouteName field.  Then, add your data_office layer to Stops (making sure to append rather than overwrite what's already in there), and again use field mapping to map the personID field to the RouteName field.  When you solve the Route layer, it will solve a separate route for each RouteName, so you'll get the path from each personID's home to work.

View solution in original post

12 Replies
MelindaMorang
Esri Regular Contributor

The way to do this is to use the Route tool instead of OD Cost Matrix.  First add your data_house layer to Stops, and use field mapping to map the personID field to the RouteName field.  Then, add your data_office layer to Stops (making sure to append rather than overwrite what's already in there), and again use field mapping to map the personID field to the RouteName field.  When you solve the Route layer, it will solve a separate route for each RouteName, so you'll get the path from each personID's home to work.

KentaOkuyama
Occasional Contributor

@Melinda Thank you so much!! I will try that out, seems it will work the best.

0 Kudos
KentaOkuyama
Occasional Contributor

It worked out perfectly. Thank you so much! 

Is there a way to do this with crow-fly distance also? 

I'm looking into Near or Generating Near Table, but I don't know if I'm on the right place. 

0 Kudos
MelindaMorang
Esri Regular Contributor

Near and Generate Near Table will do more like OD Cost Matrix and calculate the distance from each origin to all destinations.  I'm not seeing a tool that would do it based on ID fields, but this is a little bit out of my area.  You could solve the problem by iteratively selecting the points with each ID one by one and calculating Near, using a python script or model, but this would probably be pretty slow.

KentaOkuyama
Occasional Contributor

Thank you so much Melinda. I thought crow-fly distance will execute quicker than network distance. If it requires that kind of scripting (select one by one), I assume it would not be that quick. Once I get familiar with scripting more, I will try that. I really appreciate your help!

0 Kudos
JamieTratalos
Emerging Contributor

Hi Melinda,

I can't find the 'Route tool' you are referring to. I'm using ArcGIS 10.1, advance licence. I've looked in the Network Analyst tool bar (there is 'New Route' but not 'Route tool') and in the Network Analyst Tools part of ArcToolbox, but I can't find anything called 'Route tool' in either location. 

Please help - I have > 100,000 origins and a similar number of destinations, so I need a solution which pairs each origin with it's destination.

Thanks!

0 Kudos
DanPatterson_Retired
MVP Emeritus

perhaps you are confusion the network analyst toolbar with the network analyst tools in arctoolbox.

here is the link to the toolbar and what it looks like

Creating a network analysis layer in ArcMap—Help | ArcGIS Desktop 

0 Kudos
JamieTratalos
Emerging Contributor

Hi Dan, no I have not confused them - please read my message carefully - I have looked at both - thanks. There is no 'Route tool' in either (although there is 'New Route' in the Network Analyst tool bar).  Melinda, where is the 'Route tool' - thanks!

0 Kudos
DanPatterson_Retired
MVP Emeritus

duly noted

0 Kudos