Changeset 16258


Ignore:
Timestamp:
09/26/13 12:40:46 (11 years ago)
Author:
Eric.Larour
Message:

CHG: modified bamg to accept shape files

Location:
issm/trunk-jpl/src/m
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/mesh/bamg.m

    r15749 r16258  
    6464        domainfile=getfieldvalue(options,'domain');
    6565        if ~exist(domainfile,'file') error(['bamg error message: file ' domainfile ' not found']); end
    66         domain=expread(domainfile);
     66       
     67        %read domain according to its extension:
     68        [path,name,ext]=fileparts(domainfile);
     69        if strcmp(ext,'.exp'),
     70                domain=expread(domainfile);
     71        elseif strcmp(ext,'.shp'),
     72                domain=shpread(domainfile);
     73        else
     74                error(['bamg error message: file ' domainfile ' format not supported (.shp or .exp)']);
     75        end
    6776
    6877        %Build geometry
  • issm/trunk-jpl/src/m/shp/shpread.m

    r16257 r16258  
    3131for i=1:length(shp),
    3232        if strcmpi(shp(i).Geometry,'Polygon'),
    33                 x=shp(i).X; y=shp(i).Y;
     33                x=shp(i).X'; y=shp(i).Y';
    3434                ids=find(isnan(x));
    3535                x(ids)=[]; y(ids)=[];
Note: See TracChangeset for help on using the changeset viewer.