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
RevLine 
[17802]1Index: ../trunk-jpl/src/m/shp/shpread.m
2===================================================================
3--- ../trunk-jpl/src/m/shp/shpread.m (revision 17203)
4+++ ../trunk-jpl/src/m/shp/shpread.m (revision 17204)
5@@ -5,6 +5,8 @@
6 % fields x and y corresponding to the coordinates, one for the filename of
7 % the shp file, for the density, for the nodes, and a field closed to
8 % indicate if the domain is closed.
9+% If this initial shapefile is point only, the fields closed and
10+% points are ommited
11 % The first argument is the .shp file to be read and the second one (optional)
12 % indicates if the last point shall be read (1 to read it, 0 not to).
13 %
14@@ -52,6 +54,27 @@
15 end
16 end
17 end
18+
19+ if strcmpi(shp(i).Geometry,'Point'),
20+ x=shp(i).X'; y=shp(i).Y';
21+ ids=find(isnan(x));
22+ x(ids)=[]; y(ids)=[];
23+
24+ Struct(end+1).x=x;
25+ Struct(end).y=y;
26+ Struct(end).density=1;
27+ if isfield(shp,'id'),
28+ Struct(end).name=num2str(shp(i).id);
29+ else
30+ Struct(end).name='';
31+ end
32+ for j=1:length(fields),
33+ field=fields{j};
34+ if ~(strcmpi(field,'X') | strcmpi(field,'Y') | strcmpi(field,'id')),
35+ Struct(end).(field)=shp(i).(field);
36+ end
37+ end
38+ end
39 end
40
41 end
42Index: ../trunk-jpl/src/m/shp/shpdisp.m
43===================================================================
44--- ../trunk-jpl/src/m/shp/shpdisp.m (revision 17203)
45+++ ../trunk-jpl/src/m/shp/shpdisp.m (revision 17204)
46@@ -44,9 +44,14 @@
47
48 figure(figurenumber),hold on
49 for i=1:length(domain),
50- if (isnumeric(linestyle))
51- plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'Color',linestyle,'linewidth',linewidth);
52+ if(isfield(domain,'nods'))
53+ if (isnumeric(linestyle))
54+ plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'Color',linestyle,'linewidth',linewidth);
55+ else
56+ plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
57+ end
58 else
59- plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,linestyle,'linewidth',linewidth);
60+ plot(domain(i).x*unitmultiplier,domain(i).y*unitmultiplier,'ro','MarkerSize',5);
61 end
62+
63 end
Note: See TracBrowser for help on using the repository browser.