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?
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
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.
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?
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.
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).
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.