calculating driving distances

23323
25
05-19-2011 10:21 AM
DANIELWEBSTER
New Contributor
hello,

i am new to arcgis and am trying to calculate the driving distances between 2 sets of xy coordinates.

i have a data set with 5 columns--id, x-origin, y-origin, x-destination, y-destination--and would like to create a new showing the driving distance between the respective xy coordinates.

i was told that this might be possible using network analyst but have never worked with that tool.

any help would be appreciated!

Daniel
Tags (2)
0 Kudos
25 Replies
JennaKhan
New Contributor
Thanks Robert!

I was using the default search tolerance and those that had addresses were located.  I actually ended up getting rid of the pairs that didn't have both an origin and a destination.  A lot of them did not have a location for the destination and those were the ones that were unlocated - I just thought those routes would be 0 or unsolved, but that the other pairs would solve.  So now all of the stops are located and when I solve I don't get any of the previous 'unlocated' errors, but it still fails.  I don't get any error message now, I just see 'solve failed' in the network analyst sidebar at the bottom.  I had 758 pairs of locations and thought that maybe there were too many, so I tried with 10 pairs of locations and it still doesn't work, no message other than 'solve failed'.  I'm using files that were geocoded using the 10.0 North American Geocode Service (ArcGIS Online) and using the StreetMap Pro 2007 streets network - I'm  not sure if that answers your last question.  Any other thoughts Robert?

Thank you!
Jenna
0 Kudos
RobertGarrity
Esri Contributor
Hmm... Well, here are a couple things to try:

1. Turn on all messages. To do that, on the Network Analyst toolbar, click the Network Analyst drop-down menu and choose Options. On the General tab, turn on All Messages. Re-solve the problem and see if you get any more information than simply 'solve failed'.

2. What happens when you create a new route layer, interactively add two stops, group the stops into a single route, and solve? By 'interactively add', I mean use the Create Network Location tool on the Network Analyst toolbar and click on the map. To group the stops into one route, open the Stops attribute table and calculate the RouteName field. (You could calc the field to "Route1".) Then solve. Does that work?
0 Kudos
JennaKhan
New Contributor
Hi again Robert,

It worked once this morning when I tried it with only 10 pairs.  After that, I tried 758 pairs and it failed.  Then I tried 50, 25, 10 and even 9 - all failed.  I don't know what happened between the one time it worked and the subsequent times - I used the same settings.

1. I set the options to 'All Messages' and I still don't receive any error messages other than 'solve failed'

2. It does work if I interactively add 2 points, group them by name and solve, but I have 758 pairs and not much time to complete it that way. 

One thing I've noticed is that sometimes when I load the locations the names for the stops are either 'Location' with a number (starting at 1) or they are just numbers - sometimes 4 digit, other times 5 with a decimal in it.  When that happens, the pairs will have the same number, but the map appears to place everything correctly and their symbol shows them as 'located'.  Is it a problem when the load and locate that way?

Thanks!
Jenna
0 Kudos
RobertGarrity
Esri Contributor
Hello again,

I would ask you to send me some data, but I know this is patient-related, so instead, could you send me three screenshots?

1. For the naming issue, send a screenshot of the Load Locations dialog box as it is when you're loading some stops. I think what's happening is a field from your input data is being mapped to a field on your stops. When the input record has a null value for that field, Network Analyst auto-generates a name that is Location 1, Location 2, ..., Location x. When the input record has a value, that value is added to the Name field of the Stops. I'm guessing the input field contains the 4- and 5-digit numbers you're seeing.

2. A screenshot of the Network analyst window showing the paired stops to verify the stops are loaded properly. To do this, set up a partial problem by loading 10 or 50 pairs of stops only--not all 700+. Expand the Stops category, but don't worry about showing all the stops; a sample is fine.

3. The third screenshot would be of the Layer Properties dialog box--Specifically, the Analysis tab of the route layer. I'm particularly interested in whether you are using hierarchy or not. Although you can just tell me that, it would be good to see what other settings are enabled and disabled.

From what you said about solve working for 10 pairs, failing for the 700+ pairs, then failing thereafter, it sounds like this is a memory issue. However, I would expect you to get a memory warning. What happens when you do this:
Shut down ArcMap (clear out the memory).
Open it back up, and solve 25 pairs.
If that works, solve for 50 pairs.
If that works, solve for 75 pairs.
...
If you run out of memory at 700+ pairs, you'll get failures after that unless the route layer is removed or ArcGIS closed.

If memory is the issue, it may be running out of memory if you're solving without hierarchy and one or more stops is on a portion of the network that is disconnected from the rest of the network. (Imagine, for instance, a stop in a gated community and restriction is turned on that blocks the entrance to that community.) In that scenario, the solver will end up searching every edge in the network. Given you're using the North America data, memory would almost certainly be a problem. If hierarchy is disabled, enable it and solve again. You're less likely to run out of memory when using hierarchy since it search far fewer roads than an 'exact' solve.

Thanks,
Robert
0 Kudos
JennaKhan
New Contributor
Thanks Robert! That is very helpful.  I'm attaching the requested screenshots. 

The naming part makes sense now - I found the name field it's using.  One file didn't originally have a 'Name' field, so I think that's when I saw 'Location #'.

I've pretty much been using the default settings.  The only thing I've been adding to the Route Properties are the Time and Length Accumulation Attributes under the Accumulation tab.

I thought about the fact that the Network Dataset is so large and wondered if it would help if I create a new network dataset from the TIGER All Lines files only for the 5 counties where the points lie.  Would that help with the memory issue?

Thank you so much for all of your help!
Jenna
0 Kudos
RobertGarrity
Esri Contributor
Thanks for the screenshots, Jenna. It sounds like you have the naming issue figured out.

I see you're using hierarchy, which means you shouldn't run out of memory. But I guess that could happen if your computer doesn't have much RAM. How much does your machine have?

Here are a couple more things to try:
1. Before loading your stops, open the route layer's Layer Properties dialog box, click the Network Locations tab, check on Exclude Restricted Portions of the Network, then load the stops. Stops will only load on roads that are traversable. Finally, solve.

2. If you still get an error, open the Layer Properties dialog box again, click the Analysis Settings tab, then uncheck the restrictions (Oneway and Turn Restrictions), then re-solve. This should make any unreachable locations reachable.

If 2 doesn't work, I think I'll need some data from you, or if you can't send data, maybe you can tell me the counties where you're performing the analysis. This way I could create several random points in the three counties and perhaps figure out where problem areas may be. I'll send you a private message through the forums and include my email address.

TIGER data isn't really designed for routing, so it would be best to hold off on that for a bit and try to get the streetmap network to work for you.

Thanks,
Robert
0 Kudos