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

KsnProfiler using 'input_method' = 'channel_heads' #11

Closed kxwhipple closed 5 years ago

kxwhipple commented 5 years ago

KsnProfiler currently has a bug that causes it to crash if pre-selected channel heads in the form of an m x 2 array of x, y locations are used as input instead of interactive selection. It does run successfully if pre-selected channel heads are recorded in a point shapefile. Adam believes the problem with inputting a simple array of locations can be fixed with the following edit, but he is currently on the road: Replace lines 315-324 with the following:

    if ischar(chl)
        if logical(regexp(chl,regexptranslate('wildcard','*.shp')))
            ch_ms=shaperead(chl);
            ch_t=struct2table(ch_ms);
            if ~strcmp(ch_t.Geometry(1),'Point')
                error('Shapefile provided as "channel_heads" does not appear to be a point shapefile');
            end
            xi=ch_t.X;
            yi=ch_t.Y;
            chl=[xi yi];
        end
    end
amforte commented 5 years ago

Change will be implemented during next update.