2

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.

I believe I can minimize this issue by running multiple solves on the results of a Generate Near table for the 5 closest features then checking the cost for the cheapest route. It does leave the issue of a single continuous road feature that might loop back like that.

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.)

Route Snap

  • This is the first time that the term "surface streets" has appeared in a question or answer here. Can you explain what they are, please? – PolyGeo Jun 20 '16 at 22:24
  • 1
    Surface street is a colloquial term our group uses to refer to any roadway that's not a high speed freeway-highway-interstate. In the OSM dataset, anything not a motorway pretty much qualifies. – Eok Jun 20 '16 at 22:33
  • I believe I can minimize this issue by running multiple solves by chaining a Generate Near table for the 5 closest features and incrementally adding as barriers and then checking the cost. It does leave the issue of a single continuous road feature that might loop back like that. – Eok Jun 21 '16 at 19:00
  • I think additional information like this is far less likely to get overlooked by potential answerers if you edit it into your question rather than just making a comment. I notice that you have not yet taken the 2-minute Tour that is designed to introduce everyone to this site and its protocols. – PolyGeo Jun 21 '16 at 19:08
2

I think you have already listed the solution - you would need to run the Route solver multiple times as you are snapped to different links.

I don't think knowing the distance between the stop and the street links around will help you. This is because even though the link may be closest, the route will take more time to travel.

It is impossible to see from what link should the route start to yield the lowest travel time without first solving the route. I would suggest the following workflow (using Python in ArcGIS):

  1. Define the search tolerance for the snapping.
  2. Use the Closest option for the snapping, add your location to the Route layer's Stops sublayer.
  3. Solve the Route layer. Record the travel time.
  4. Obtain the ObjectID of the first link of the route.
  5. Modify the Query of the snapping by adding the ObjectID above (which will prohibit the Route to snap to this particular link).
  6. Solve the Route layer. Record the travel time.

Repeat the steps 4-6 for every link that could be found within the search tolerance. When your Stop will be unlocated at some point, this means you have routed through all possible links within the search tolerance. Go ahead and pick the route with the lowest travel time.

If you want to incorporate the distance from the stop to the street link starting from which gave you the lowest travel time to the destination, you can then find the distance between those two features (using arcpy or any other valid method) and append the travel time to the route while you are comparing the routes generated.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.