Changeset 24294


Ignore:
Timestamp:
10/30/19 11:52:16 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: fixing exp2shp.m

File:
1 edited

Legend:

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

    r22929 r24294  
    2626
    2727%initialize number of profile
    28 count=0;
     28count=1;
    2929
    3030contours=struct([]);
    3131for i=1:length(shp),
    3232        if nargin < 3
    33                 if length(shp(1).x) == 1
     33
     34                %TEMP
     35                %if contains(shp(i).name,'_pointcloud');
     36                %       continue;
     37                %end
     38
     39                if length(shp(i).x) == 0
     40                        continue;
     41                elseif contains(shp(i).name,'_pointcloud');
     42                        geometry = 'MultiPoint';
     43                        shp(i).name = erase(shp(i).name,'_pointcloud');
     44                elseif length(shp(i).x) == 1
    3445                        geometry = 'Point';
    35                 elseif length(shp(1).x) < 3
     46                elseif length(shp(i).x) < 3
    3647                        geometry = 'Line';
    3748                else
    38                         if (shp(1).x(end)==shp(1).x(1) && shp(1).y(end)==shp(1).y(1)),
     49                        if (shp(i).x(end)==shp(i).x(1) && shp(i).y(end)==shp(i).y(1)),
    3950                                geometry = 'Polygon';
    4051                        else
     
    4354                end
    4455        end
    45         contours(i).Geometry=geometry;
    46         contours(i).id=i;
    47         contours(i).X=shp(i).x;
    48         contours(i).Y=shp(i).y;
     56        contours(count).Geometry=geometry;
     57        contours(count).id=i;
     58        contours(count).Name=shp(i).name;
     59        contours(count).X=shp(i).x;
     60        contours(count).Y=shp(i).y;
     61        count = count+1;
    4962end
    50        
     63
     64%Make sure it is one single geometry otherwise it will yell at you
    5165shapewrite(contours,shpfilename);
Note: See TracChangeset for help on using the changeset viewer.