[21726] | 1 | Index: ../trunk-jpl/src/m/exp/exp2shp.m
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/exp/exp2shp.m (revision 21651)
|
---|
| 4 | +++ ../trunk-jpl/src/m/exp/exp2shp.m (revision 21652)
|
---|
| 5 | @@ -1,16 +1,27 @@
|
---|
| 6 | -function exp2shp(shapefilename,expfilename,geometry)
|
---|
| 7 | +function exp2shp(expfilename,shpfilename,geometry)
|
---|
| 8 | %SHPWRITE - write a shape file from a contour structure
|
---|
| 9 | %
|
---|
| 10 | % Usage:
|
---|
| 11 | -% exp2shp(shapefilename,expfilename,geometry)
|
---|
| 12 | +% exp2shp(expfilename,shpfilename,geometry)
|
---|
| 13 | %
|
---|
| 14 | % Example:
|
---|
| 15 | -% exp2shp('domainoutline.shp','domainoutline.exp')
|
---|
| 16 | -% exp2shp('domainoutline.shp','domainoutline.exp','Polygon')
|
---|
| 17 | -% exp2shp('massfluxgate.shp','massfluxgate.exp','Line')
|
---|
| 18 | +% exp2shp('domainoutline.exp','domainoutline.shp')
|
---|
| 19 | +% exp2shp('domainoutline.exp','domainoutline.shp','Polygon')
|
---|
| 20 | +% exp2shp('massfluxgate.exp','massfluxgate.shp','Line')
|
---|
| 21 | %
|
---|
| 22 | % See also SHPREAD, SHPWRITE, SHP2EXP
|
---|
| 23 |
|
---|
| 24 | +%check file extensions
|
---|
| 25 | +[pathstr,name,ext] = fileparts(shpfilename);
|
---|
| 26 | +if ~strcmp(ext,'.shp'),
|
---|
| 27 | + error(['Shapefile ' shpfilename ' does not have an extension .shp']);
|
---|
| 28 | +end
|
---|
| 29 | +
|
---|
| 30 | +[pathstr,name,ext] = fileparts(expfilename);
|
---|
| 31 | +if ~strcmp(ext,'.exp'),
|
---|
| 32 | + error(['Exp file ' expfilename ' does not have an extension .exp']);
|
---|
| 33 | +end
|
---|
| 34 | +
|
---|
| 35 | shp=expread(expfilename);
|
---|
| 36 |
|
---|
| 37 | %initialize number of profile
|
---|
| 38 | @@ -33,5 +44,4 @@
|
---|
| 39 | contours(i).Y=shp(i).y;
|
---|
| 40 | end
|
---|
| 41 |
|
---|
| 42 | -shapewrite(contours,shapefilename);
|
---|
| 43 | -end
|
---|
| 44 | +shapewrite(contours,shpfilename);
|
---|