source: issm/oecreview/Archive/16554-17801/ISSM-17203-17204.diff@ 17802

Last change on this file since 17802 was 17802, checked in by Mathieu Morlighem, 11 years ago

Added archives

File size: 2.1 KB
  • ../trunk-jpl/src/m/shp/shpread.m

     
    55%   fields x and y corresponding to the coordinates, one for the filename of
    66%   the shp file, for the density, for the nodes, and a field closed to
    77%   indicate if the domain is closed.
     8%   If this initial shapefile is point only, the fields closed and
     9%   points are ommited
    810%   The first argument is the .shp file to be read and the second one (optional)
    911%   indicates if the last point shall be read (1 to read it, 0 not to).
    1012%
     
    5254                        end
    5355                end
    5456        end
     57
     58        if strcmpi(shp(i).Geometry,'Point'),
     59                x=shp(i).X'; y=shp(i).Y';
     60                ids=find(isnan(x));
     61                x(ids)=[]; y(ids)=[];
     62
     63                Struct(end+1).x=x;
     64                Struct(end).y=y;
     65                Struct(end).density=1;
     66                if isfield(shp,'id'),
     67                        Struct(end).name=num2str(shp(i).id);
     68                else
     69                        Struct(end).name='';
     70                end
     71                for j=1:length(fields),
     72                        field=fields{j};
     73                        if ~(strcmpi(field,'X') | strcmpi(field,'Y') | strcmpi(field,'id')),
     74                                Struct(end).(field)=shp(i).(field);
     75                        end
     76                end
     77        end
    5578end
    5679
    5780end
  • ../trunk-jpl/src/m/shp/shpdisp.m

     
    4444
    4545figure(figurenumber),hold on
    4646for i=1:length(domain),
    47         if (isnumeric(linestyle))
    48                 plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'Color',linestyle,'linewidth',linewidth);
     47        if(isfield(domain,'nods'))
     48                if (isnumeric(linestyle))
     49                        plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'Color',linestyle,'linewidth',linewidth);
     50                else
     51                        plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
     52          end
    4953        else
    50                 plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
     54                plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'ro','MarkerSize',5);
    5155        end
     56       
    5257end
Note: See TracBrowser for help on using the repository browser.