View source code of the function ge_contourf() in the MATLAB editor
Google Earth toolbox contents

ge_contourf

Visualizing filled contour maps in Google Earth.

Syntaxgo to top

kmlStr = ge_contourf(X,Y,M)
[kmlStr,contourCell] = ge_contourf(...)
[...] = ge_contourf(X,Y,M,Parameter,Value)

Descriptiongo to top

kmlStr = ge_contourf(X,Y,M)

Visualizing contour maps in Google Earth. "X" contains the location longitudes whereas "Y" contains the location latitudes of the data in the 2D numerical array "M". "M" should at least be 2x2. "X" and "Y" must be the same size as "Z". "X" must be monotonically increasing with increasing column number; "Y" must be monotonically decreasing with increasing row number.

[kmlStr,contourCell] = ge_contourf(...)

When two output arguments are specified, ge_contourf also returns a cell array with data about the contours. The columns of this array are the x-coordinates, y-coordinates, area, level, and hexadecimal color string, respectively.

[...] = ge_contourf(X,Y,M,Parameter,Value)

In addition to the above, a number of options can be set regarding the appearance of the contourmap. Assigning values to the parameters can be accomplished by inclusion of an alternating sequence of parameters and their value. The table below provides an overview of the authorized options. The order in which the parameters are included does not matter. Please be aware that the options are case-sensitive. Examples are provided further down.

ParameterDescription
'altitude'Height difference relative to the plane of reference (see parameter 'altitudeMode').
'altitudeMode'Specifies which plane of reference to use. Must be one of 'absolute', 'relativeToGround' or 'clampToGround'. Note that transparency only works when set to 'relativeToGround'.
'cLimHigh'Specifies the value to which the maximum of the colorbar should apply. Default is max(M(:)).
'cLimLow'Specifies the value to which the minimum of the colorbar should apply. Default is min(M(:)).
'colorMap'Specifies the colormap to use for visualizing the grid cell colors. Default is 'jet', but any MATLAB colormap can be used.
'extrude'See Extruding objects.
'lineAlpha'Line alpha specification (transparency). Intensity values are denoted as two-digit hexadecimal numbers ranging from 00 to FF. For example, '80' is semi-transparent and 'FF' is fully opaque.
'lineColor'Line color specification, excluding transparency. Color value format must be passed as a character array according to the format string 'RRGGBB', with 'RR', 'GG', and 'BB' representing red, green, and blue colors, respectively. Intensity values are denoted as two-digit hexadecimal numbers ranging from 00 to FF. For example, 'FF0000' is red and '0000FF' is blue.
'lineWidth'Width of the contour lines. Default is 0.1. Set to zero for no lines.
'lineValues'1xN array defining the contour line levels. Not to be used in conjuction with parameter 'numClasses'.
'msgToScreen'Defines whether verbose feedback is provided by the function when it is accessed and when it finishes. Default is false (which is equivalent to logical(0), but quicker).
'numClasses'Number of classes to be used between 'cLimLow' and 'cLimHigh'. Default is 10.
'polyAlpha'2-digit hexadecimal character array specifying the transparency of the grid ('00' is fully transparent; 'FF' is fully opaque).
'tessellate'See Tessellation.
'timeSpanStart'See Dynamic visualization.
'timeSpanStop'See Dynamic visualization.
'visibility'Whether the object is initially visible. Must be passed to ge_contourf() as a numerical value 1 or 0. Visibility state can be changed within the Google Earth Viewer by clicking the object's checkmark in the 'Places' pane.

Remarksgo to top

Latitudes on the Southern hemisphere must be passed as negative values. Same for longitudes on the Western hemisphere.

Latitudes and longitudes should be passed in units of decimal degrees (also known as fractional degrees). Google Earth uses Simple Cylindrical projection (also known as Plate Carée) with a WGS84 datum.

Examplesgo to top

demo_ge_contourf provides an example of the use of ge_contourf(). It will generate a *.kml file that looks like the image below when opened in the Google Earth viewer.