source:
issm/oecreview/Archive/25834-26739/ISSM-26540-26541.diff
| Last change on this file was 26740, checked in by , 4 years ago | |
|---|---|
| File size: 1.9 KB | |
-
../trunk-jpl/src/m/modules/ExpToLevelSet.m
13 13 14 14 % Check usage 15 15 if nargin~=3 16 help ExpToLevelSet17 error('Wrong usage (see above)');16 help ExpToLevelSet 17 error('Wrong usage (see above)'); 18 18 end 19 19 20 20 multipleShp = 0; 21 21 22 22 if ischar(contourname), 23 [path,name,ext]=fileparts(contourname);24 if strcmpi(ext,'.shp'),25 %read contour from shapefile26 contourname=shpread(contourname);27 if isstruct(contourname)28 multipleShp = size(contourname, 2);29 end30 end23 [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 31 31 end 32 32 33 33 % Call mex module 34 34 if multipleShp>0 35 % shp file contains multiple contours36 distance = zeros(length(x)+1, multipleShp);37 for i = 1:multipleShp38 distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));39 % append the NAME information at the end of the distance40 if isfield(contourname(i),'NAME')41 distance(end, i) = contourname(i).NAME;42 else35 % 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 43 43 distance(end, i) = i; 44 end45 end44 end 45 end 46 46 else 47 % single shape or exp file48 distance = ExpToLevelSet_matlab(x,y,contourname);47 % single shape or exp file 48 distance = ExpToLevelSet_matlab(x,y,contourname); 49 49 end
Note:
See TracBrowser
for help on using the repository browser.
![(please configure the [header_logo] section in trac.ini)](/trac/issm/chrome/common/trac_banner.png)