Changeset 21781


Ignore:
Timestamp:
07/13/17 14:15:26 (8 years ago)
Author:
Mathieu Morlighem
Message:

CHG: more flexibiligty

File:
1 edited

Legend:

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

    r21651 r21781  
    3737                expstruct(end).density=1;
    3838                expstruct(end).closed=1;
    39                 expstruct(end).name=num2str(shp(i).id);
     39                if isfield(shp(i),'id'),
     40                        expstruct(end).name=num2str(shp(i).id);
     41                elseif isfield(shp(i),'NAME'),
     42                        expstruct(end).name=num2str(shp(i).SUBREGION1);
     43                elseif isfield(shp(i),'SUBREGION1'),
     44                        expstruct(end).name=num2str(shp(i).SUBREGION1);
     45                else
     46                        expstruct(end).name='unknown';
     47                end
    4048        elseif strcmpi(shp(i).Geometry,'Point'),
    4149                x=shp(i).X; y=shp(i).Y;
Note: See TracChangeset for help on using the changeset viewer.