kml.contour3

Create a 3D contour of altitude in a grid defined by longitude and latitude. Similar to the built-in contour3 function.

Contents

Syntax

kml.contour3(long, lat, alt)
kml.contour3(...,'PropertyName',PropertyValue,...)

Description

Creates a 3D contour plot of altitude in a grid defined by longitude vs. latitude, similar to the built-in contour3 function, in the sense that the contours are placed at their corresponding altitude level.

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.

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

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

Properties

Property NameTypeDescription
'name' string Name of the plot inside the kml file
'description' string A short description of what the plot represents
'visibility' true/false Control the initial visibility of the plot
'colorMap' string name of a valid colormap function Defines in which colormap the contour will be plotted. Example of valid inputs: 'jet', 'hsv', 'hot', 'cool', 'spring', 'summer', 'autumn', 'winter', 'gray', 'bone', 'copper', 'pink'
'numberOfLevels' double or 'auto' Defines number of levels in which the altitude input should be split into. Valid inputs are either the desired number of levels or 'auto'
'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 contour 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 contour 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 contour 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');

% Plot a sample 3D contour plot to the kml
[x,y,z] = peaks(200);
k.contour3(180*x/3,90*y/3,1e5*z+1e4,'numberOfLevels',40,'altitudeMode','absolute');

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