Changeset 24313 for issm/trunk/src/m/exp/exp2shp.m
- Timestamp:
- 11/01/19 12:01:57 (5 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/m/exp/exp2shp.m
r23189 r24313 26 26 27 27 %initialize number of profile 28 count= 0;28 count=1; 29 29 30 30 contours=struct([]); 31 31 for i=1:length(shp), 32 32 if nargin < 3 33 if length(shp(1).x) == 1 33 34 %TEMP 35 %if contains(shp(i).name,'_pointcloud'); 36 % continue; 37 %end 38 39 if length(shp(i).x) == 0 40 continue; 41 elseif contains(shp(i).name,'_pointcloud'); 42 geometry = 'MultiPoint'; 43 shp(i).name = erase(shp(i).name,'_pointcloud'); 44 elseif length(shp(i).x) == 1 34 45 geometry = 'Point'; 35 elseif length(shp( 1).x) < 346 elseif length(shp(i).x) < 3 36 47 geometry = 'Line'; 37 48 else 38 if (shp( 1).x(end)==shp(1).x(1) && shp(1).y(end)==shp(1).y(1)),49 if (shp(i).x(end)==shp(i).x(1) && shp(i).y(end)==shp(i).y(1)), 39 50 geometry = 'Polygon'; 40 51 else … … 43 54 end 44 55 end 45 contours(i).Geometry=geometry; 46 contours(i).id=i; 47 contours(i).X=shp(i).x; 48 contours(i).Y=shp(i).y; 56 contours(count).Geometry=geometry; 57 contours(count).id=i; 58 contours(count).Name=shp(i).name; 59 contours(count).X=shp(i).x; 60 contours(count).Y=shp(i).y; 61 count = count+1; 49 62 end 50 63 64 %Make sure it is one single geometry otherwise it will yell at you 51 65 shapewrite(contours,shpfilename);
Note:
See TracChangeset
for help on using the changeset viewer.