source: issm/oecreview/Archive/25834-26739/ISSM-26540-26541.diff

Last change on this file was 26740, checked in by Mathieu Morlighem, 3 years ago

CHG: added 25834-26739

File size: 1.9 KB
  • ../trunk-jpl/src/m/modules/ExpToLevelSet.m

     
    1313
    1414% Check usage
    1515if nargin~=3
    16     help ExpToLevelSet
    17     error('Wrong usage (see above)');
     16        help ExpToLevelSet
     17        error('Wrong usage (see above)');
    1818end
    1919
    2020multipleShp = 0;
    2121
    2222if ischar(contourname),
    23     [path,name,ext]=fileparts(contourname);
    24     if strcmpi(ext,'.shp'),
    25         %read contour from shapefile
    26         contourname=shpread(contourname);
    27         if isstruct(contourname)
    28             multipleShp = size(contourname, 2);
    29         end
    30     end
     23        [path,name,ext]=fileparts(contourname);
     24        if strcmpi(ext,'.shp'),
     25                %read contour from shapefile
     26                contourname=shpread(contourname);
     27                if isstruct(contourname)
     28                        multipleShp = size(contourname, 2);
     29                end
     30        end
    3131end
    3232
    3333% Call mex module
    3434if multipleShp>0
    35     % shp file contains multiple contours
    36     distance = zeros(length(x)+1, multipleShp);
    37     for i = 1:multipleShp
    38         distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));
    39         % append the NAME information at the end of the distance
    40         if isfield(contourname(i),'NAME')
    41             distance(end, i) = contourname(i).NAME;
    42         else
     35        % shp file contains multiple contours
     36        distance = zeros(length(x)+1, multipleShp);
     37        for i = 1:multipleShp
     38                distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));
     39                % append the NAME information at the end of the distance
     40                if isfield(contourname(i),'NAME')
     41                        distance(end, i) = contourname(i).NAME;
     42                else
    4343                        distance(end, i) = i;
    44         end       
    45     end
     44                end       
     45        end
    4646else
    47     % single shape or exp file
    48     distance = ExpToLevelSet_matlab(x,y,contourname);
     47        % single shape or exp file
     48        distance = ExpToLevelSet_matlab(x,y,contourname);
    4949end
Note: See TracBrowser for help on using the repository browser.