Obtaining stream flow direction

6462
21
Jump to solution
02-20-2014 06:28 AM
MarkBrown
Deactivated User
Greetings,

I have a polyline stream layer (shapefile) and I want to know if there is a way to find the cardinal flow direction  (N, NE, E, SE, S...) of each individual stream segment?  I have a DEM, but I am not interested in the terrain flow direction that water would normally flow. I am looking to find the cardinal flow direction of the stream(s) segments themselves. My ultimate goal is to determine the average stream flow direction within a polygon layer using a spatial join.

I am not sure if this matters, but I have From_Nodes and To_Nodes, reach codes and distances in my attribute table.

I hope this makes sense.

Any and all information, tools, tips, tricks is greatly appreciated.

Thanks....

Mark
0 Kudos
21 Replies
MarkBrown
Deactivated User
Hi Mark,

I had some problems with the "custom" coordinate system, but I have attached a toolbox with the functionality and also an updated file geodatabase. Unzip the toolbox ("toolshare2.zip") and navigate with the ArcCatalog window to the unzip location. Try the tools inside. Hope they work for you.

The SL distance (length) that is returned follows the linear unit of the input featureclass. In your case it is US_Foot.

Kind regards,

Xander



Xander...

Worked like a charm.  I tried it on a couple of other datasets and there does not seem to be any issues.  The data is consistent to what I was looking for.  Much more manageable as well.

One other question.....if in the future I wanted to further divide the cardinal flow directions from the earlier script into even smaller units of degrees (i.e. 0-11.25 degrees N, 11.25 - 22.5 NNE, etc...) I could modify that script to do calculate those flow directions/angles, correct?

You and Duncan have been of great help.  Thanks for all your time and patience with me.

Greatly appreciated...

v/r

Mark
0 Kudos
XanderBakker
Esri Esteemed Contributor
Hi Mark,

Yes you can. In the Python script locate the following section of code:

def getCardinal(angle):     lstCardinal = [[22.5,"E"], [67.5, "NE"], [112.5, "N"],                    [157.5, "NW"], [202.5, "W"], [247.5, "SW"],                    [292.5, "S"], [337.5, "SE"], [360, "E"]]


This is a nested list, where each element (e.g. "[22.5,"E"]") in the list holds information on the upper limit of the angles class (e.g. 22.5°) and the cardinal flow direction (e.g. "E"). You can expand the list with as many items as you want, as long as the angles are in the right order. So:

def getCardinal(angle):     lstCardinal = [[11.25,"E"], [33.75,"ENE"],                     [56.25, "NE"], [78.75, "NNE"],                     [101.25, "N"], [123.75, "NNW"],                      etc...                    [348.75, "ESE"], [360, "E"]]


Just remember that the angle is arithmetic (not geographic). 0° is East and the angle increments counter clockwise...

BTW; if you consider your question answered, please check the mark (turns green when you click on it) next to the post that answered you question most.

Kind regards,

Xander
0 Kudos