-
Notifications
You must be signed in to change notification settings - Fork 5
/
mStat_ExportKml.m
32 lines (26 loc) · 1009 Bytes
/
mStat_ExportKml.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function mStat_ExportKml(name,latlon1,latlon2,latlon3)
%makes a kml file for use in google earth
%input: name of track, one matrix containing latitude and longitude
%usage: pwr_kml('track5',latlon)
header=['<kml xmlns="http://earth.google.com/kml/2.0"><Placemark><description>"' name '"</description><LineString><tessellate>1</tessellate><coordinates>'];
footer='</coordinates></LineString></Placemark></kml>';
fid = fopen([name '_Centerline.kml'], 'wt');
d=flipud(rot90(fliplr(latlon1)));
fprintf(fid, '%s \n',header);
fprintf(fid, '%.6f,%.6f,0.0 \n', d);
fprintf(fid, '%s', footer);
fclose(fid);
clear d
fid = fopen([name '_MeanCenterLine.kml'], 'wt');
d=flipud(rot90(fliplr(latlon2)));
fprintf(fid, '%s \n',header);
fprintf(fid, '%.6f,%.6f,0.0 \n', d);
fprintf(fid, '%s', footer);
fclose(fid);
clear d
fid = fopen([name '_InflectionPointsLine.kml'], 'wt');
d=flipud(rot90(fliplr(latlon3)));
fprintf(fid, '%s \n',header);
fprintf(fid, '%.6f,%.6f,0.0 \n', d);
fprintf(fid, '%s', footer);
fclose(fid);