Changeset 17026
- Timestamp:
- 12/17/13 14:46:22 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/shp/Shp2Exp.m
r16852 r17026 15 15 shp=shaperead(shapefilename); 16 16 17 exp =struct([]);17 expstruct=struct([]); 18 18 for i=1:length(shp), 19 19 if strcmpi(shp(i).Geometry,'Polygon'), … … 21 21 ids=find(isnan(x)); 22 22 x(ids)=[]; y(ids)=[]; 23 24 exp(end+1).x=x; 25 exp(end).y=y; 26 exp(end).nods=length(x); 27 exp(end).density=1; 28 exp(end).closed=1; 29 exp(end).name=num2str(shp(i).id); 23 expstruct(end+1).x=x; 24 expstruct(end).y=y; 25 expstruct(end).nods=length(x); 26 expstruct(end).density=1; 27 expstruct(end).closed=1; 28 expstruct(end).name=num2str(shp(i).id); 30 29 elseif strcmpi(shp(i).Geometry,'Point'), 31 x=shp(i).X; y=shp(i).Y; 32 33 exp(end+1).x=x; 34 exp(end).y=y; 35 exp(end).nods=length(x); 36 exp(end).density=1; 37 exp(end).closed=1; 38 %exp(end).name=num2str(shp(i).id); 30 x=shp(i).X; y=shp(i).Y; 31 expstruct(end+1).x=x; 32 expstruct(end).y=y; 33 expstruct(end).nods=length(x); 34 expstruct(end).density=1; 35 expstruct(end).closed=1; 36 %exp(end).name=num2str(shp(i).id); 37 elseif strcmpi(shp(i).Geometry,'Line'), 38 x=shp(i).X; y=shp(i).Y; 39 expstruct(end+1).x=x; 40 expstruct(end).y=y; 41 expstruct.x(end)=x(1); 42 expstruct.y(end)=y(1); 43 expstruct(end).nods=length(x); 44 expstruct(end).density=1; 45 expstruct(end).closed=1; 39 46 end 40 47 end 41 48 42 expwrite(exp ,expfilename);49 expwrite(expstruct,expfilename);
Note:
See TracChangeset
for help on using the changeset viewer.