Changeset 6299
- Timestamp:
- 10/14/10 15:02:17 (15 years ago)
- Location:
- issm/trunk/src/m/kml
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/kml/kml_mesh_write.m
r6278 r6299 12 12 % 13 13 % and the optional input is: 14 % data (numeric, results data)14 % data (numeric, element or nodal results data) 15 15 % alt (numeric, altitude for polygons, default 10000) 16 16 % lwidth (numeric, line width in pixels, default 1) 17 17 % popac (numeric, polygon opacity, default 0.50) 18 % cmin (numeric, minimum of color scale)19 % cmax (numeric, maximum of color scale)18 % cmin (numeric, minimum of color map) 19 % cmax (numeric, maximum of color map) 20 20 % cmap (char or numeric, colormap definition) 21 % prtplt (char, 'off'/'no' for partition segment plot) 21 22 % 22 23 function []=kml_mesh_write(varargin) … … 256 257 % write folder for partition segments 257 258 258 if md.npart 259 if (~exist('prtplt','var') || strncmpi(prtplt,'on' ,2) || strncmpi(prtplt,'y',1)) && ... 260 md.npart 259 261 [xseg,yseg]=flagedges(md.elements,md.x,md.y,md.part); 260 262 fprintf(fid,' <Folder>\n'); … … 264 266 md.npart,size(xseg,1)); 265 267 266 % write each element as a polygon268 % write each segment as a linestring 267 269 268 270 disp(['Writing ' num2str(size(xseg,1)) ' partition segments as KML linestrings.']); … … 289 291 end 290 292 293 % write folder for partition edges 294 295 if (~exist('prtplt','var') || strncmpi(prtplt,'on' ,2) || strncmpi(prtplt,'y',1)) && ... 296 md.npart 297 [edgeadj,edgeuns,elemuns]=edgeadjacency(md.elements,md.nodeconnectivity); 298 fprintf(fid,' <Folder>\n'); 299 fprintf(fid,' <name>Partition Edges</name>\n'); 300 fprintf(fid,' <visibility>1</visibility>\n'); 301 fprintf(fid,' <description>Partitions=%d, Edges=%d</description>\n',... 302 md.npart,size(edgeuns,1)); 303 304 % write each partition edge as a linestring 305 306 disp(['Writing ' num2str(size(edgeuns,1)) ' partition edges as KML linestrings.']); 307 for i=1:size(edgeuns,1) 308 fprintf(fid,' <Placemark>\n'); 309 fprintf(fid,' <name>Edge %d</name>\n',i); 310 fprintf(fid,' <visibility>1</visibility>\n'); 311 fprintf(fid,' <styleUrl>#RedLineRedPoly</styleUrl>\n'); 312 fprintf(fid,' <LineString>\n'); 313 fprintf(fid,' <extrude>1</extrude>\n'); 314 fprintf(fid,' <tessellate>1</tessellate>\n'); 315 fprintf(fid,' <altitudeMode>relativeToGround</altitudeMode>\n'); 316 fprintf(fid,' <coordinates>\n'); 317 for j=1:2 318 [lat(j),long(j)]=mapxy(md.x(edgeuns(i,j)),md.y(edgeuns(i,j)),'s'); 319 fprintf(fid,' %0.16g,%0.16g,%0.16g\n',long(j),lat(j),alt); 320 end 321 322 fprintf(fid,' </coordinates>\n'); 323 fprintf(fid,' </LineString>\n'); 324 fprintf(fid,' </Placemark>\n'); 325 end 326 fprintf(fid,' </Folder>\n'); 327 end 328 291 329 % write trailer data 292 330
Note:
See TracChangeset
for help on using the changeset viewer.