Changeset 6561
- Timestamp:
- 11/12/10 11:15:30 (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
r6461 r6561 33 33 if (nargin >= 1) 34 34 filek=varargin{1}; 35 end36 if ~exist('filek' ,'var') || isempty(filek)37 filek=input('kml file to write? ','s');38 end39 [pathstr,name,ext,versn] = fileparts(filek);40 if isempty(ext)41 ext='.kml';42 end43 filek2=fullfile(pathstr,[name ext versn]);44 45 display(sprintf('Opening kml file ''%s''.',filek2));46 fid=fopen(sprintf('%s',filek2),'w');47 if (fid < 0)48 error('File ''%s'' could not be opened.',filek2);49 35 end 50 36 … … 108 94 end 109 95 110 %% write kml file 111 112 % write header data 113 114 fprintf(fid,'<?xml version="1.0" encoding="UTF-8"?>\n'); 115 fprintf(fid,'<kml xmlns="http://www.opengis.net/kml/2.2">\n'); 96 %% construct kml document 116 97 117 98 kdoc=kml_document(); … … 255 236 end 256 237 257 % write document 258 259 display(sprintf('Writing kml file ''%s''.',filek2)); 260 kml_write(kdoc,fid,' '); 261 262 % write trailer data 263 264 fprintf(fid,'</kml>\n'); 265 266 if (fclose(fid) < 0) 267 error('File ''%s'' could not be closed.',filek2); 268 else 269 disp(['End of file ''' filek2 ''' successfully written.']); 270 end 271 272 end 273 238 %% write kml file 239 240 kml_file_write(kdoc,filek); 241 242 end 243
Note:
See TracChangeset
for help on using the changeset viewer.