Select to view content in your preferred language

Least Cost Path tool

1762
3
08-14-2012 10:06 AM
Labels (1)
BillFalvey
Deactivated User
Hi folks:
We are doing some analysis on CAFO sites (concentrated animal feeding) and trying to determine where the likely path is for pollution runoff to drainage systems.  We ran the least cost path analysis on DEMs (in concert with hydro tools-"fill" and "flow direction") and converted these paths to polylines.  Some of them end at the drainage (which is what we wanted) but others continue down the drainage, crossing and re-crossing the drainage).  We searched for a script that would end the polyline at the
first intersection (flow line at drainage) but all we found was a script going back to 8.3; does anyone have any ideas for getting the flowline to end where it hits the drainages?
Thanks in advance for your time,
Bill Falvey
Tags (2)
0 Kudos
3 Replies
MarkBoucher
Honored Contributor
I'm not sure if this is exactly what you want...

I just played around with this. If the value in the flow direction (fdr) grid is 255 then a flow tracing tool stops there. I believe 255 is an "official" direction in the fdr. You can find this in the flow direction helps.

  • I took a polyline layer that represented my creeks and added a integer field to the table and made all the values 255.

  • I using the Conversion>To Raster tool I converted the polylines to Raster255 taking care to set the cell size equal to my fdr raster.

  • I then used the IsNull command to make my "IsNull" raster. This is a raster where locations with cells equal to Null are 1 and the cells that had 255 were 0.

  • I then ran the Con() function on the IsNull and tested if the value in IsNull was 0. If true, the answer is the result is Raster255, if false the answer is fdr.

This process created a final fdr255 raster that had 255 as the flow direction in the creeks and when I use the flow path tracer, the trace always ended at the creek. The red lines in the image are flow traces, the blue creeks, the green watershed boundaries.

It was easy to set this up in model builder. I assume this "logic" can be put into a script.

You'll want to carefully specify which creeks/streams/rivers to use for creating the Raster255 layer.

[ATTACH=CONFIG]16955[/ATTACH]
0 Kudos
BillFalvey
Deactivated User
Mark:
Thanks much for the info; just got back to the office late today and will attempt your solution tomorrow.   Is the "flow path tracer" in Arc Hydro?  I am unfamiliar with that tool...
BIll Falvey
US Fish & Wildlife Service
Cortland, NY
PS-could you provide a screen shot of the model or the Python text?
0 Kudos
MarkBoucher
Honored Contributor
Bill,
I just noticed that you had replied to the thread with the question below and I can't send you a private msg.
The flow path tracer is in the Arc Hydro toolbar. Did you figure it out? Do you still need the model screenshot? (not sure if I kept it)
Mark
0 Kudos