Changeset 16340


Ignore:
Timestamp:
10/08/13 12:08:09 (11 years ago)
Author:
Eric.Larour
Message:

CHG: modification to not wipe out all fields of the shape file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/shp/shpread.m

    r16339 r16340  
    2929
    3030Struct=struct([]);
     31fields=fieldnames(shp);
    3132for i=1:length(shp),
    3233        if strcmpi(shp(i).Geometry,'Polygon'),
     
    4546                        Struct(end).name='';
    4647                end
     48                for j=1:length(fields),
     49                        field=fields{j};
     50                        if ~(strcmpi(field,'X') | strcmpi(field,'Y') | strcmpi(field,'id')),
     51                                Struct(end).(field)=shp(i).(field);
     52                        end
     53                end
    4754        end
    4855end
Note: See TracChangeset for help on using the changeset viewer.