Select to view content in your preferred language

Closest facility accuracy issue

2601
6
Jump to solution
12-05-2013 12:59 PM
dl
by
Occasional Contributor
Hi, I'm using the closest facility tool for the first time and am having some trouble, though it is the same issue even with the simple route function, which I have used before.

I have a location, and want to find the distance along a road to another location, however it is not taking anywhere near the closest route. I have used this road dataset before (a street network from Geobase), and not had any troubles. Essentially, there are certain intersections that it refuses to drive through on some occasions, but will drive through them on others, and instead takes a hugely convoluted route around.

What I'm wondering, is what are the settings which could possibly be causing this problem? It just seems to set a route up and down random blocks sometimes.

Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MelindaMorang
Esri Regular Contributor
Hi.  Here's what's going on:
When you set up your network dataset, a cost attribute was created called Cost with units of kilometers.  The Evaluators for a cost attribute tell the network how to calculate the impedance on each network edge.  So, the Cost attribute should have an evaluator that tells the network how many kilometers each edge has.  Your Cost attribute's evaluator just gets this value from the "cost" field in the input roads2 feature class.  However, if you open the attribute table of roads2, the value of everything in the "cost" field is 0.  Consequently, the network thinks that every edge is 0 kilometers long.  Consequently, it doesn't matter which roads you take to get from Point A to Point B because the result is 0 kilometers no matter what.

In order to solve your problem, you need to create a better network dataset with a good cost attribute.  Since you've said you're not very experienced with Network Analyst, I think your best bet is to go through some of the tutorials (http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000005r000000).  Start with the "creating a network dataset" one and make sure you really understand what's going on with the attributes and evaluators.

If you're still having trouble after working through the tutorials, post again, and we'll help you out.

View solution in original post

0 Kudos
6 Replies
MelindaMorang
Esri Regular Contributor
Are you using any restrictions in your analysis?  Perhaps the roads your routes refuse to travel on are restricted.

Does your network have turns in it?  Perhaps particular turns through an intersection are restricted or have large delays imposed on them, which discourages travel there.

Maybe your network isn't well connected.  Pick one of the intersections in question and use the Network Identify tool (from the Network Analyst toolbar) to click on the streets leading into that intersection.  In the box that pops up, you'll see the edges and junctions that are connected to the selected road.  If you click on them in the Network Identify window, they will highlight on the map, so you can make sure that all the roads that should be connected actually are.
0 Kudos
dl
by
Occasional Contributor
There are no roads where the routes won't travel, ie. Imagine driving from Seattle to Los Angelas. One time it will go through Portland (demonstrating that it has this ability and that the road networks are connected), but the next time it will inexplicably go over to New York first. I have left everything default and have not set any restrictions, so I don't believe there should be any.

Below are some screenshots illustrating the issue. The first image shows it taking a long route around to a point two blocks away. Thesecond image shows it taking the correct route to a point one intersection closer. The third image shows that it has the ability to go through all these intersections, even though it takes a crazy route.

http://imgur.com/q1hV4pI
http://imgur.com/OFZKXZn
http://imgur.com/Q8IJW6I

Perhaps I'm just missing something really obvious, thanks for any help
0 Kudos
MelindaMorang
Esri Regular Contributor
Yep, those are pretty crazy looking.  Can you share your data (network dataset and mxd with NALayer)?  I would be happy to take a look at it for you and see if I can figure out what's happening.
0 Kudos
dl
by
Occasional Contributor
I don't know what an NAlayer is; here is the mxd, roads file, and network dataset file (I think this is everything)

It is literally new arcmap document, drag in the roads shapefile, convert to a network dataset with all of the default settings (model turns, no elevation, no directions). I then just open the network analyst toolbar, click new route, and select to points along the roads and the issue happens. I'm certain I've used this tool in the past in this way without issue. Thanks for any help.

https://www.dropbox.com/s/wgdn833y1ovrqoe/Roads.7z
0 Kudos
MelindaMorang
Esri Regular Contributor
Hi.  Here's what's going on:
When you set up your network dataset, a cost attribute was created called Cost with units of kilometers.  The Evaluators for a cost attribute tell the network how to calculate the impedance on each network edge.  So, the Cost attribute should have an evaluator that tells the network how many kilometers each edge has.  Your Cost attribute's evaluator just gets this value from the "cost" field in the input roads2 feature class.  However, if you open the attribute table of roads2, the value of everything in the "cost" field is 0.  Consequently, the network thinks that every edge is 0 kilometers long.  Consequently, it doesn't matter which roads you take to get from Point A to Point B because the result is 0 kilometers no matter what.

In order to solve your problem, you need to create a better network dataset with a good cost attribute.  Since you've said you're not very experienced with Network Analyst, I think your best bet is to go through some of the tutorials (http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000005r000000).  Start with the "creating a network dataset" one and make sure you really understand what's going on with the attributes and evaluators.

If you're still having trouble after working through the tutorials, post again, and we'll help you out.
0 Kudos
dl
by
Occasional Contributor
Thank you for looking into this for me!

I see what happened now; last time I calculated the length of all the roads in the attribute table and input that as the cost when creating the network dataset, which gave me what I wanted. I'll have a look through the tutorial so I have a better understanding of all the features.

Thanks again
0 Kudos