Exclude non traversable portions of the network

503
7
Jump to solution
02-27-2018 06:40 AM
Highlighted
New Contributor III

i am facing an issue where Route Analyst is placing network locations on non traversable portions of the network, (see image below).

In arcpy.na.AddLocations i am using in the "exclude_restricted_elements" parameter the value EXCLUDE. Any ideas? 

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Regular Contributor

There is a difference between a restricted element and a non-reachable element. The AddLocations only looks at what is currently restricted. It is not checking for connectivity. So if the inner square for pedestrian roads has a pedestrian restriction and that is currently on, then the location will not snap to it. But if it is simply a disconnected portion then it will locate on to it. The subsequent solve will tell you that the stop location cannot be reached.

Jay Sandhu

View solution in original post

7 Replies
Highlighted
Esri Regular Contributor

Can you show the entire add locations line that you are passing in? Perhaps you are using Network Location fields in the Field Mappings to map existing network locations instead of using Geometry.

Jay Sandhu

Reply
0 Kudos
Highlighted
New Contributor III

Yes of course;

arcpy.na.AddLocations(outNALayer, stopsLayerName, inStops_2, fieldMappings, "300 meters", "FID", [["Analysis_ND", "SHAPE"], ["Analysis_ND", "NONE"]], "MATCH_TO_CLOSEST", "APPEND", "SNAP", "1", "EXCLUDE", "")

do i have to add a query?

Reply
0 Kudos
Highlighted
Esri Regular Contributor

Are you using ArcMap or ArcGIS Pro?

If you are using ArcMap, then, are you setting the route layer properties such as restrictions after you load the locations? That is, you need to make sure all the route layer properties are set before you load the locations. This ensures that the correct restricted network elements are excluded.

Also, the picture you posted does not explain what is the problem. I see a red point but not sure what it means.

Jay Sandhu

Highlighted
New Contributor III

Thank you for your prompt reply, I am using ArcMap 10.4.1 and i have set all the layer properties before "arcpy.na.AddLocations". In the image we can see that a stop (the red point) has been snapped on a non traversable segment of the network (the inner square is a pedestrian road that has no connections with any other network segment).

Reply
0 Kudos
Highlighted
Esri Regular Contributor

There is a difference between a restricted element and a non-reachable element. The AddLocations only looks at what is currently restricted. It is not checking for connectivity. So if the inner square for pedestrian roads has a pedestrian restriction and that is currently on, then the location will not snap to it. But if it is simply a disconnected portion then it will locate on to it. The subsequent solve will tell you that the stop location cannot be reached.

Jay Sandhu

View solution in original post

Highlighted
New Contributor III

Understood, if i want to exclude non-reachable elements should i delete those elements or is there any different approach(apart from creating restrictions)?

Reply
0 Kudos
Highlighted
Esri Regular Contributor

For add locations, besides deletion, you can either use a restriction and/or a query. So if there is some description that is attached to those pedestrian streets that can help avoid locating on them, than a query can be passed in. 

Some help on query is here: Snapping network locations with Build Query—Help | ArcGIS Desktop 

Another option can be to have the pedestrian streets in a different feature class, so the network data will have more than on line source. Then the add locations can be instructed with the optional search criteria to locate only on the line source that you want to locate on. Look for the help on search_criteria (and search_query) here:

Add Locations—Help | ArcGIS Desktop 

Jay Sandhu