amforte / Topographic-Analysis-Kit

Set of matlab based tools for topographic analysis, built on top of TopoToolbox.
GNU General Public License v3.0
42 stars 35 forks source link

Manually extracting KSN of individual stream reaches #34

Closed abn-codes closed 4 years ago

abn-codes commented 4 years ago

Hey Adam, I'm using the KsnProfiler to measure the stream steepness of individual stream reaches within a river network. Within matlab, this works well and the code displays the measured stream steepness of the individual reach bounded by the selected points on the profile ("knickpoints").

I'm confused though because the segments of the shapefile that is generated do not match the bounds of the selected stream reach? The shapefile displays metrics for each reach bounded by stream junctions (not the reaches bounded by the selected 'knickpoints').

Maybe i'm not doing the routine correctly, but is there a way to output a shapefile for the reach bounded by the knickpoints? -- so the Ksn in the shapefile attributes table matches what was profiled in TAK?

Let me know if you have some advice. Thanks!

Gekotadori commented 4 years ago

Hi, Recently, I started using TAK to plot a combined swath with ksn and Precipitation. My ksn and precipitation data are in a separate data 'Data' with their 'Lat(x)','Long(y)','Elevations(z)', 'Mean precipitation ' and 'Ksn' recipectivelly as (a matrix n x 5 ). When I try to use the combinedswath function , the data points or small circles are not appearing on my swath.

The function I used is ''[SW,SwathMat,xypoints,bends]=MakeTopoSwath(DEM,[,],1000,'points5','D',500,'vex',10,true,'plot_figure',true);''

The error message appearing on my screen is ''Error using MakeTopoSwath 'points5' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for MakeTopoSwath.

Error in MakeTopoSwath (line 57) parse(p,DEM,points,width,varargin{:});''

Any solution for this issue please?

amforte commented 4 years ago

For the first issue @abn-codes brings up - this is a function of the way the shapefile is created. There will be some amount of averaging within bins (the length of which is defined by the 'smooth_distance' parameter) that may cross bounds defined in the profiling process. The only way programatically around this is a much less efficient way of generating the shapefile that would take A LOT longer to produce. A sort of kludgey solution is to set the smooth_distance to a smaller value so the size of the bins is less, though you cannot decrease the smooth distance below 3x the cellsize, i.e. for a 90 m dem, the minimum smooth distance is 270 meters.

For the issue from @AsfawEr (and in the future, please submit a separate issue if your issue is totally unrelated to a previous issue as is the case here): MakeTopoSwath does not have a 'points5' option because this is just for making topographic swaths. You want MakeCombinedSwath.