Code covered by the BSD License  

Highlights from
kml line plot

5.0

5.0 | 1 rating Rate this file 19 Downloads (last 30 days) File Size: 2.92 KB File ID: #34006
image thumbnail

kml line plot

by

 

29 Nov 2011 (Updated )

Draw nan-separated lines (or a single line) onto Google Earth.

| Watch this File

File Information
Description

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);

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
18 Jan 2013 Mathieu  
Updates
30 Nov 2011

updated description to include support for single lines

30 Nov 2011

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

01 Dec 2011

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

02 Dec 2011

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

13 Apr 2012

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

Contact us