kml line plot

版本 1.6.0.0 (2.9 KB) 作者: Cameron Sparr
Draw nan-separated lines (or a single line) onto Google Earth.
981.0 次下载
更新时间 2012/4/13

查看许可证

This function takes in standard nan-separated arrays (such as for a coastline), and draws them onto Google Earth.

It can also handle a single lon/lat track that has no NaN values (such as a ship or airplane track).

Syntax:
KML_LINE(LON, LAT) writes nan-separated lines specified
in LON and LAT to an output file, doc.kml
KML_LINE(LON, LAT, NAME) writes nan-separated lines specified
in LON and LAT to an output file, NAME.kml
KML_LINE(LON, LAT, NAME, COLOR) writes lines same as above but with
MATLAB color value (default is 'w').
KML_LINE(LON, LAT, NAME, WIDTH) writes lines same as above but with
width WIDTH (default is 1).
KML_LINE(LON, LAT, NAME, COLOR, WIDTH) writes lines same as above but
with width WIDTH and color COLOR.

Input:
LON: 1-D array of longitude line values. Separate lines are separated
by a NaN. Must correspond to LAT.
LAT: 1-D array of latitude line values. Separate lines are separated
by a NaN. Must correspond to LON.
NAME: String name of output file (without the .kml extension)
COLOR: MATLAB color (default is 'w'), supports vector colors.
WIDTH: int or float width value (default is 1)

Output:
This function creates a kml file called NAME.kml in the current
working directory

Examples:
% four different ways of calling kml_line:
load('palau_coastline.mat');
kml_line(lon_coast, lat_coast, 'palau_coastline');
kml_line(lon_coast, lat_coast, 'palau_coastline', 'r');
kml_line(lon_coast, lat_coast, 'palau_coastline', 1.5);
kml_line(lon_coast, lat_coast, 'palau_coastline', 'm', 2);

引用格式

Cameron Sparr (2024). kml line plot (https://www.mathworks.com/matlabcentral/fileexchange/34006-kml-line-plot), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.6.0.0

Now prints out 10 digits of accuracy as opposed to 4.

1.5.0.0

Now uses ge_color function so that the color input can be in standard MATLAB form.

1.4.0.0

Major revision on how it handles line styles (now makes use of styleUrl). Also added support for writing a KML without specifying a name.

1.3.0.0

Updated file to support changes in the color and/or width of the lines

1.1.0.0

updated description to include support for single lines

1.0.0.0