Including snapped distance in Network Analyst route cost?

2332
5
06-20-2016 04:54 PM
Highlighted
by
New Contributor III

In designing a routing tool, I'm attempting to minimize the amount of surface streets (non-motorways) needed to reach the closest facilities. The only options available in Network Analyst are snap to closest feature or snap to first feature (within some tolerance radius) when using the AddLocations tool.

As you can see from the image below, the code will snap the input location via part 1 every time (either by closest or by first). The favorable direction is to snap via path 2 to avoid that southern loop.

RouteSnap.png

Does anyone have any ideas of how to route using part 2?

(Note: The Network dataset shown below is from OpenStreetMap and prohibits travel on motorways and motorway links. All the remaining roadways are to be treated equally in this scenario.)

Reply
0 Kudos
5 Replies
Highlighted
MVP Esteemed Contributor

if it were just a few, I would just move the point so at least your rule would still be useful

Reply
0 Kudos
Highlighted
by
New Contributor III

The purpose of the tool is to minimize / eliminate this type of decision making for the end user.

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

then you will have to devise your rules and use Jay's solution.  I have seen mine work when the point is actually just representing the centroid of a shopping mall so its actual location is not relevant...moving the point gives it a preferential location given that the option would be to add routes into the shopping mall and incorporate those into the network as well.  The latter approach would only be worthwhile if you were considering routing for paratranspo services that may need information for multi-entrance malls.  So you have many options, depending on how critical any time differences are.

Reply
0 Kudos
Highlighted
Esri Regular Contributor

You can have more control on where a location is snapped by adding some logic to the snapping. See the section titled "Snapping environment with Build Query" here:

What are network analysis objects?—Help | ArcGIS for Desktop

Also you can calculate one of the Attr_ fields on the input stops for additional cost to be added to the route. The Attr_ field should correspond to the cost attribute your are solving on and in the same units. You can read more on them in the Stop Properties section here:

Route analysis—Help | ArcGIS for Desktop

Jay

Reply
0 Kudos
Highlighted
by
New Contributor III

The build query achieves the same thing as my restriction does already. As I mentioned, the remaining roads are all valid routes.

Pre-adding snapping distance as a cost doesn't solve the issue since the snapping distance is part of the total cost variable.

Reply
0 Kudos