function mod_ge_output(filename,output,pltparams, varargin) % % % Please use the link below to view the documentation. % % If you don't see the link which is automatically inserted by MATLAB, % % try removing the line break above, so that this help block is merged % % with the previous one. % % Reference page in help browser: ge_output % % etm mods lines 36-44 to define a style to NOT get directions in the % balloons % no time slider in this implementation AuthorizedOptions = authoptions('ge_output' ); % Assign default values to parameters: name = filename; msgToScreen = false; parsepairs %script that parses Parameter/value pairs. if msgToScreen disp(['Running ' mfilename '...']) end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% fileoutput = filename( (end-2):end ); if strcmp(fileoutput,'kml') fid = fopen(filename, 'wt'); % header includes style definitions for use by the icons & baloons, % and the USGS overlay, and a helpful note about using the time-slider header = ['',10,... '',10,... '',10,... '',10,name,10,'',10,... '',10,... '',10,... 'USGS Logo',10,... ' Created by the USGS Coastal Marine Geology Progrm',10,... ' 1 ',10,... ' ',10,... ' http://stellwagen.er.usgs.gov/images/header_graphic_usgsIdentifier_green.jpg',10,... ' ',10,... ' ',10,... ' ',10,... ' ',10,... '',10,... '',10,... 'inst_id',10,... ' 1' ]; footer = [10, '',10,... '',10,... '']; fprintf(fid,'%s',header); fprintf(fid,'%s',output); fprintf(fid,'%s',footer); fclose(fid); elseif strcmp(fileoutput,'kmz') newfilename = filename(1:(end-4)); newfilename = strcat(newfilename,'.kml'); fid = fopen( newfilename, 'wt'); header = ['',10,... '',10,... '',10,... '',10,name,10,'',10]; footer = [10,'',10,... '',10]; fprintf(fid,'%s',header); fprintf(fid,'%s',output); fprintf(fid,'%s',footer); fclose(fid); zip(filename,newfilename); if ispc eval(['!del ',newfilename] ); eval(['!move ',filename, '.zip ', filename]) else eval(['!rm -f ',newfilename]); eval(['!mv ',filename, '.zip ', filename]) end else error('unsupported file extension used in ge_output'); end if msgToScreen disp(['Running ' mfilename '...Done']) end