Changeset 18213


Ignore:
Timestamp:
07/01/14 18:00:34 (11 years ago)
Author:
schlegel
Message:

CHG: add geometry settings

File:
1 edited

Legend:

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

    r18211 r18213  
    1 function exp2shp(shapefilename,expfilename)
     1function exp2shp(shapefilename,expfilename,geometry)
    22%SHPWRITE - write a shape file from a contour structure
    33%
    44%   Usage:
    5 %      exp2shp(shapefilename,expfilename)
     5%      exp2shp(shapefilename,expfilename,geometry)
    66%
    77%   Example:
    88%      exp2shp('domainoutline.shp','domainoutline.exp')
     9%      exp2shp('domainoutline.shp','domainoutline.exp','Polygon')
     10%      exp2shp('massfluxgate.shp','massfluxgate.exp','Line')
    911%
    1012%   See also SHPREAD, SHPWRITE, SHP2EXP
     
    1719contours=struct([]);
    1820for i=1:length(shp),
    19         contours(i).Geometry='Polygon';
     21        if nargin < 3
     22                if length(shp(1).x) == 1
     23                        geometry = 'Point';
     24                elseif length(shp(1).x) < 3
     25                        geometry = 'Line';
     26                else
     27                        geometry = 'Polygon';
     28                end
     29        end
     30        contours(i).Geometry=geometry;
    2031        contours(i).id=i;
    2132        contours(i).X=shp(i).x;
Note: See TracChangeset for help on using the changeset viewer.