Changeset 21652


Ignore:
Timestamp:
03/30/17 10:53:50 (8 years ago)
Author:
Mathieu Morlighem
Message:

CHG: pass exp as first argument + added check on extension

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/exp/exp2shp.m

    r18213 r21652  
    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
     13
     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
    1324
    1425shp=expread(expfilename);
     
    3445end
    3546       
    36 shapewrite(contours,shapefilename);
    37 end
     47shapewrite(contours,shpfilename);
Note: See TracChangeset for help on using the changeset viewer.