source: issm/oecreview/Archive/21337-21723/ISSM-21651-21652.diff@ 21726

Last change on this file since 21726 was 21726, checked in by Mathieu Morlighem, 8 years ago

CHG added Archive/21337-21723

File size: 1.4 KB
  • ../trunk-jpl/src/m/exp/exp2shp.m

     
    1 function exp2shp(shapefilename,expfilename,geometry)
     1function exp2shp(expfilename,shpfilename,geometry)
    22%SHPWRITE - write a shape file from a contour structure
    33%
    44%   Usage:
    5 %      exp2shp(shapefilename,expfilename,geometry)
     5%      exp2shp(expfilename,shpfilename,geometry)
    66%
    77%   Example:
    8 %      exp2shp('domainoutline.shp','domainoutline.exp')
    9 %      exp2shp('domainoutline.shp','domainoutline.exp','Polygon')
    10 %      exp2shp('massfluxgate.shp','massfluxgate.exp','Line')
     8%      exp2shp('domainoutline.exp','domainoutline.shp')
     9%      exp2shp('domainoutline.exp','domainoutline.shp','Polygon')
     10%      exp2shp('massfluxgate.exp','massfluxgate.shp','Line')
    1111%
    1212%   See also SHPREAD, SHPWRITE, SHP2EXP
    1313
     14%check file extensions
     15[pathstr,name,ext] = fileparts(shpfilename);
     16if ~strcmp(ext,'.shp'),
     17        error(['Shapefile ' shpfilename ' does not have an extension .shp']);
     18end
     19
     20[pathstr,name,ext] = fileparts(expfilename);
     21if ~strcmp(ext,'.exp'),
     22        error(['Exp file ' expfilename ' does not have an extension .exp']);
     23end
     24
    1425shp=expread(expfilename);
    1526
    1627%initialize number of profile
     
    3344        contours(i).Y=shp(i).y;
    3445end
    3546       
    36 shapewrite(contours,shapefilename);
    37 end
     47shapewrite(contours,shpfilename);
Note: See TracBrowser for help on using the repository browser.