280 likes | 358 Views
Francis Rengers, Theo Spinelli, Arthur Smith. Automating Watershed Analysis. Introduction. Watershed Wizardary , Let’s try to automate it!. West Bijou Creek. Methods. The only way of finding the limits of the possible is by going beyond them into the impossible. ~ Arthur C. Clarke.
E N D
Francis Rengers, Theo Spinelli, Arthur Smith Automating Watershed Analysis
Introduction Watershed Wizardary, Let’s try to automate it!
Methods The only way of finding the limits of the possible is by going beyond them into the impossible.~ Arthur C. Clarke
Stream Generalization This is the result of stream creation. As you can see, it is very detailed and we really only want to see the effects of the major channels.
Stream Order STRAHLER METHOD Stream order only increases when two streams of the same order connect into another, then a new order is created.
Calculating Max Stream Order Stream Order Raster Attribute Table Summery Statistics on Value Field, Max We want a value of 3. Actually, whichever is the max value. The code
Selecting Max Value *Take Note, the script example for Select by attributes in ArcHelp is WRONG! Not to mention tricky…
The Francis Problem • Want dissolve our shape file to get ONE row. • Without getting a Multi-part shapefile.
The Francis Problem This works perfectly
The Francis Problem . . . but not Every time
Cross-Sections • Goal: • Create points perpendicular to the stream channel that have elevation and distance info
Cross-Sections • Locate Cross Sections: • User specifies the distance interval to cut cross-sections (e.g. 15 m) • If Total Dist> Specified Dist, the Cross Section is on the current segment. • Get X,Y coords for Cross Section location. • Need Hypotenuse • Hyp=Line Segment Dist-(Total Dist-Specified Dist) • Find the angle of the line segment • Tanq=|x2-x1|/|y2-y1| • Xcenter=(-1b )Cosq*hyp+x1 • Ycenter=(-1c )Sinq*hyp+y1 • If x2>x1, b=2, else b=1. • If y2>y1, c=2, else c=1. (x1,y1) hyp q Is the same up here 15m ? q (x2,y2)
Cross-Sections y • Make Cross-Sections: • Create a unit vector that represents the Line segment. • Now centered on (0,0). Note this only works on square projections like UTM. • Normal Vector (just flip and switch): • If (i>0 and j>0) or (i<0 and j<0) • Quadrant 1 or 3. • If (i>0 and j<0) or (i<0 and j>0) • Quadrant 2 or 4 (x1,y1) IV I hyp (0,0) stuff i q x (x2,y2) stuff j III II
Cross-Sections y • Make Cross-Sections: • Tan(a)=|j|/|i| • Determine Endpoints: • xe1=Xcenter + Cos(a)*XSlength • xe2=Xcenter - Cos(a)*XSlength • If Quadrant 1 or 3 • ye1=Ycenter + Sin(a)*Xslength • ye2=Ycenter - Sin(a)*Xslength • If Quadrant 2 or 4 • ye1=Ycenter - Sin(a)*Xslength • ye2=Ycenter + Sin(a)*Xslength • Xnew=x1- Cos(a)*PntDist • Ynew=y1 +/- Sin(a)*PntDist • Append Xnew and Ynew to a list, then dump in a shapefile IV I (xe1,ye1) Normal i a a x Normal j XSlength (xe2,ye2) II III
Longitudinal Profiles Input Data: 1m Filled DEM, cross section center points Process: Use GP tool to extract raster elevation value for stream polyline nodes Output Data: Elevation and distance fields added to attribute table of stream nodes Use: Plot elevation vs. distance to create stream profiles
Longitudinal Profiles • From cross section center points, locations are known, but not distances between them. • For loop shown below calculates distance from current point to last point and keeps track of the cumulative distance • Cumulative distance and elevation, for each stream, are dumped into a textfile for further analysis or graphing
Results 60% of the time it works 100% of the time
Cross Sections Works most of the time
Longitudinal Profiles: Challenges • Main Issue: Displaying data automatically • Textfiles of data can be a pain to graph, it would be nice to output graphs automatically • This is possible using matplotlib(see image), however we ran into difficulty with multiple profiles in one graph and compatibility issues
Discussion Too Big to Not Fail
Discussion • Splitting code up into more modules that are easier to debug (366 lines of code). • Maybe should change XS code so it works on multipart. • Problems with vector analysis • Might be easier to use Numpy arrays to extract the main channels. • We want an extra module for Matplotlib for an automated display.
Conclusions Momma always said, life is like a box of chocolates . . .
Final product • We can generate streams and watersheds • We can create cross-sections and longitudinal profiles • Can Plot our cross-sections • Some editing must occur in between. • http://watershedmapping.wordpress.com/