Network Analyst route - no solution found

7849
8
Jump to solution
08-05-2015 02:28 AM
Highlighted
New Contributor

Hello,

My problem is that the Solve tool in Network Analyst fails to find a route between stops in my network dataset. The stops are locating correctly (see attached screenshot "located points"), but the Solver returns an error "Warning: No route from location X to location Y. Error: No solution found" (see attached screenshot "error message"). This happens even when I dynamically add stops using the "Create Network Location Tool" for testing. The network is a simple grid with adjacent and diagonal connections at regular intervals. I've attached the shapefile on which the network is based (tempgrid.shp).

Any help would be greatly appreciated. The details of my network dataset are below:

Name: tempgrid_ND

Type: Shapefile-Based Network Dataset

Sources:

   Edge Sources:

     tempgrid

Connectivity:

   Group 1:

     Edge Connectivity:

       tempgrid (End Point)

Elevation Model: None

Attributes:

   Length:

     Usage Type: Cost

     Data Type: Double

     Units Type: Unknown

     Use by Default: True

     Source Attribute Evaluators:

       tempgrid (From-To): Field

           Language: VBScript

           Expression: [EdgeCost]

       tempgrid (To-From): Field

           Language: VBScript

           Expression: [EdgeCost]

     Default Attribute Evaluators:

       Default Edges: Constant = 0

       Default Junctions: Constant = 0

Directions:

   Directions Ready: No

     -Length Attribute Required

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Regular Contributor

I looked at your network, and it appears that it isn't well-connected at the junctions.  The lines don't start and stop at exactly the same location at the points where they're supposed to intersect, so it's impossible for the route to transition from horizontal to vertical lines sometimes.  Probably your snapping settings weren't quite right when you created the network.

The easiest thing to do is probably to use the Integrate tool.  This tool will make minor adjustments to the input feature geometry so that endpoints will coincide.

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

You might also need to use "Any Vertex" connectivity instead of "End Point" if you want the center points of your diagonals to connect.

Finally, I recommend making your network dataset in file geodatabase format instead of Shapefile.  File geodatabase is newer and cleaner and has fewer limitations than the much older Shapefile format.

View solution in original post

8 Replies
Highlighted
Esri Regular Contributor

I looked at your network, and it appears that it isn't well-connected at the junctions.  The lines don't start and stop at exactly the same location at the points where they're supposed to intersect, so it's impossible for the route to transition from horizontal to vertical lines sometimes.  Probably your snapping settings weren't quite right when you created the network.

The easiest thing to do is probably to use the Integrate tool.  This tool will make minor adjustments to the input feature geometry so that endpoints will coincide.

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

You might also need to use "Any Vertex" connectivity instead of "End Point" if you want the center points of your diagonals to connect.

Finally, I recommend making your network dataset in file geodatabase format instead of Shapefile.  File geodatabase is newer and cleaner and has fewer limitations than the much older Shapefile format.

View solution in original post

Highlighted
New Contributor

Melinda, thank you very much for your reply. Integrating the network with the junctions seemed to do the job.

If I may ask a couple of follow-up questions:

1. I created the network grid programmatically in python by building segments individually. Is there a way to apply snapping settings with arcpy to prevent this from happening in the future?

2. I originally wanted to do this in a file geodatabase. However, my workflow requires that I periodically overwrite the feature class on which the network is based and re-build the network. I have a script in python that does this; however, when the feature class is in a geodatabase, it cannot be overwritten as long as it is participating in the network dataset. Shapefiles do not have this restriction, i.e. I can overwrite a shapefile that is participating in a network database and re-build the network without any problems. Do you know if there is a way to overwrite feature classes in a geodatabase that are participating in a network dataset? If so, I will certainly use that instead.

Thank you again for your help.

Scott

Reply
0 Kudos
Highlighted
Esri Regular Contributor

1. What tool or python methods are you using to programmatically create your line segments?  This is a bit outside my area of expertise, but I'm guessing there's some kind of environment settings for the tool you could put into place.  Or perhaps the Snap tool would help? ArcGIS Help (10.2, 10.2.1, and 10.2.2) If you describe your workflow a bit more thoroughly, I can try to help more.

2. Ah, interesting.  As you have discovered, you can't delete the feature class.  You could, however, delete all the features in the feature class (use Delete Rows or an update cursor) and then add the new features to the existing feature class.  Again, this might depend on how you're creating the features.

Reply
0 Kudos
Highlighted
New Contributor

I'm creating lines from point geometry, similar to the example in this thread: arcgis desktop - How to convert arcpy.InsertCursor to arcpy.da.InsertCursor in Python code? - Geogra...

I did a little more digging and found that the Snap tool works well for my purposes, and seems to be more efficient than the Integrate tool: Snap—Help | ArcGIS for Desktop

Unfortunately, it would be too time-consuming to delete features in the geodatabase feature class and add the new features back to the feature class, so I will be stuck with shapefiles for the time being.

Thanks again for your help!

Reply
0 Kudos
Highlighted
New Contributor

By the way, Melinda, how were you able to tell that my network was not well-connected at the junctions? I'd like to know how to diagnose similar problems in the future.

Reply
0 Kudos
Highlighted
MVP Frequent Contributor

I can't answer directly for Melinda, but one way to evaluate the network is to run topology rules on the linework used to create the network.  For example, running the rule "Must not have dangles' will help find gaps in the linework.

Small gaps in the linework can be surprisingly common, as many line datasets were not set up to snap the lines together.  The resulting gaps are often very small, to the point where they are not visibly noticeable.  So everything looks great when viewing the linework, but from a Network perspective they are disconnected.

One caveat - checking the topology results will take some reviewing, as some dangles are real, so are not really errors.  For examples, all the dead-end streets will be flagged as dangles.

Topology rules

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

Chris Donohue, GISP

Highlighted
Esri Regular Contributor

Once the network has been created, you can add it to ArcMap and use the Network Identify tool (on the Network Analyst toolbar on the right side) to click on streets and see which other streets and junctions they are connected to.  The Network Identify window gives you a list of stuff the identified street is connected to, and you can click each one and have them flash in the map.  If roads that look like they should be connected don't show up in this list, then they aren't connected.

However, I agree with Chris Donohue that it's better to fix these errors before creating your network dataset in the first place.

Highlighted
New Contributor

Chris and Melinda -- thanks again! Good things to keep in mind when creating network datasets in the future.

Reply
0 Kudos