kml.scatter3
Places markers in the coordinates defined by longitude, latitude and altitude. Similar to built-in scatter function.
Contents
Syntax
kml.scatter3(long, lat, alt) kml.scatter3(...,'PropertyName',PropertyValue,...)
Description
Places markers in the coordinates defined by the inputs longitude, latitude and altitude. Similar to built-in scatter3 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. Altitude is always given in meters.
For a list of available markers, run: help kml.parseIconURL
It is possible to fine tune the scatter3 plot properties using name-value pairs:
kml.scatter3(...,'PropertyName',PropertyValue,...)
Properties
Property Name | Type | Description |
---|---|---|
'name' | string | Name of the scatter3 plot inside the kml file |
'id' | string | Internal id of this scatter3 plot inside the kml |
'description' | string | A short description of what the scatter3 plot represents |
'visibility' | true/false | Control the initial visibility of the scatter3 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 |
'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 scatter3 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 scatter3 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 scatter3 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 3D scatter plot in the kml k.scatter3(360*rand(100,1)-180,180*rand(100,1)-90,linspace(0,1e6,100).','iconScale',linspace(5,10,100).','iconColor',[zeros(100,1) linspace(0,1,100).' zeros(100,1) 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)