Changeset 24885
- Timestamp:
- 05/22/20 09:30:15 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/mesh3dsurface.m
r24852 r24885 200 200 format=getfieldvalue(options,'format','shp'); 201 201 geometry=getfieldvalue(options,'geometry','line'); 202 index=getfieldvalue(options,'index',[]); 203 proj=getfieldvalue(options,'projection',''); 202 204 203 205 %prepare contours: … … 233 235 end 234 236 elseif strcmpi(geometry,'polygon'), 235 counter=1; 236 for i=1:self.numberofelements, 237 el=self.elements(i,:); 238 contours(i).x=[self.long(el(1)) self.long(el(2)) self.long(el(3)) self.long(el(1))]; 239 contours(i).y=[self.lat(el(1)) self.lat(el(2)) self.lat(el(3)) self.lat(el(1))]; 240 contours(i).Geometry = 'Polygon'; 237 if isempty(index), 238 counter=1; 239 for i=1:self.numberofelements, 240 el=self.elements(i,:); 241 contours(i).x=[self.long(el(1)) self.long(el(2)) self.long(el(3)) self.long(el(1))]; 242 contours(i).y=[self.lat(el(1)) self.lat(el(2)) self.lat(el(3)) self.lat(el(1))]; 243 contours(i).Geometry = 'Polygon'; 244 contours(i).Id = i; 245 end 246 else 247 counter=1; 248 for i=1:length(index), 249 el=self.elements(index(i),:); 250 contours(i).x=[self.long(el(1)) self.long(el(2)) self.long(el(3)) self.long(el(1))]; 251 contours(i).y=[self.lat(el(1)) self.lat(el(2)) self.lat(el(3)) self.lat(el(1))]; 252 contours(i).id = index(i); 253 contours(i).Geometry = 'Polygon'; 254 end 241 255 end 242 256 else … … 253 267 end 254 268 269 %write projection file: 270 if ~isempty(proj), 271 proj2shpprj(filename,proj); 272 end 273 274 %write style file: 275 applyqgisstyle(filename,'mesh'); 276 277 255 278 256 279
Note:
See TracChangeset
for help on using the changeset viewer.