kml.scatter

Places markers in the coordinates defined by longitude and latitude. Similar to built-in scatter function.

Contents

Syntax

kml.scatter(long, lat)
kml.scatter(...,'PropertyName',PropertyValue,...)

Description

Places markers in the coordinates defined by the inputs longitude and latitude. Similar to built-in scatter function.

The units for latitude and longitude are normally given in degrees, but this can be changed by calling: kml.useDegrees; or kml.useRadians; before plotting.

For a list of available markers, run: help kml.parseIconURL

It is possible to fine tune the scatter plot properties using name-value pairs:

kml.scatter(...,'PropertyName',PropertyValue,...)

Properties

Property NameTypeDescription
'name' string Name of the scatter plot inside the kml file
'id' string Internal id of this scatter plot inside the kml
'description' string A short description of what the scatter plot represents
'visibility' true/false Control the initial visibility of the scatter plot
'iconColor' kml color string Defines the color of the markers. Must be a valid hex color string input, in the style AABBGGRR
'iconScale' double Defines the size of each marker. Can be one input for all markers, or an array with the same size as Latitude and Longitude, with the size of each marker
'iconURL' string Selects which type of marker will be used. A list of available markers can be seen by running help kml.parseIconURL
'altitude' double Altitude where each marker will be placed. Can be one altitude for all, or an array with a value for each marker. Input in meters
'altitudeMode' string Choose if the altitude value is absolute to the earth model, relative to the ground level, or should be clamped to the ground. Valid inputs: 'absolute', 'relativeToGround', 'clampToGround'
'timeStamp' kml date string Associates the scatter plot to a moment in time. Should not be used together with timeSpan. Should be a string in the XML time format (more information available here)
'timeSpanBegin' kml date string Defines the moment in time where the scatter plot starts to exist. Should not be used together with timeStamp. Should be a string in the XML time format (more information available here)
'timeSpanEnd' kml date string Defines the moment in time where the scatter plot finishes to exist. Should not be used together with timeStamp. Should be a string in the XML time format (more information available here)

Example

% Create a new kml object
k = kml('my kml file');

% Creates a random scatter plot in the kml
k.scatter(360*rand(100,1)-180,180*rand(100,1)-90,'iconScale',linspace(5,10,100).','iconColor',[linspace(0,1,100).' zeros(100,2) linspace(0,1,100).'])

% Save the kml and open it in Google Earth
k.run;

This is the result of running this example:

This file is part of the kml toolbox. Copyright 2012 Rafael Fernandes de Oliveira (rafael@rafael.aero)