Hello everybody,
Does anybody know how I can generate multiple paths (not just least cost one) between two points? I want to have several alternatives of paths connecting two point in my map.
I have an idea of writing a code with "for" loop and use "costPath" tool in each iteration and find LCP; then exclude the resulting LCP from the model prior to the next iteration and find a new LCP.
I have no idea how to perform it!! Is there a way to do this algorithm in ArcMap by python scripting?
I hope I am clear enough to explain the issue.
Thank you,
Sara
Solved! Go to Solution.
I have done a similar analysis trying to obtain multiple routes between two points. What I did was to include in the next step the previous route as exclusion (NoData in the cost raster for a small buffer around the vectorized path). Make sure that for a small area around the start and end point you leave the cost values, since otherwise you will not get any result.
I have done a similar analysis trying to obtain multiple routes between two points. What I did was to include in the next step the previous route as exclusion (NoData in the cost raster for a small buffer around the vectorized path). Make sure that for a small area around the start and end point you leave the cost values, since otherwise you will not get any result.
Thank you very much Xander for your help,
Do you know how I can relax the assumption of NoData in areas around start and destination?
I used the tool "Expand raster" to create a buffer around my LCP raster and set all cells in the buffer to NoData. I dont know to retain the values for area around start and destination.
Sara
I used a procedure which was vector based and consisted of the following steps:
Since your source and end points are raster, you can use the expand to create a raster holding the source and destination pixels and some pixels arround them. You also need the buffer of the route (or another expand raster on the raster that holds the pixels of the route) to combine them into a new cost raster.
What you want to do is create some map algebra that will do the following:
Suppose you have the following rasters:
The Map Algebra in the Raster Calculator would look something like:
Con(IsNull("xpnd_src_dest"), Con(IsNull("xpnd_route"), "cost_ras", "nd_ras"), "cost_ras")
This will yield a cost raster that you can use in the next run.
Kind regards, Xander