kml.poly3
Create a 3D polygon with vertices given by longitude, latitude and altitude.
Contents
Syntax
kml.poly3(long, lat, alt) kml.poly3(...,'PropertyName',PropertyValue,...)
Description
Creates a 3D polygonal form, with vertices given by longitude, latitude and altitude.
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 polygon properties using name-value pairs:
kml.poly3(...,'PropertyName',PropertyValue,...)
Properties
Property Name | Type | Description |
---|---|---|
'name' | string | Name of the polygon polygon the kml file |
'id' | string | Internal id of this plot inside the kml |
'description' | string | A short description of what the polygon represents |
'visibility' | true/false | Control the initial visibility of the polygon |
'lineColor' | kml color string | Defines the color of the polygon lines. Must be a valid hex color string input, in the style AABBGGRR |
'polyColor' | kml color string | Defines the color of the polygon faces. Must be a valid hex color string input, in the style AABBGGRR |
'lineWidth' | double | Defines the width of the polygon lines. Set to zero to show no lines. |
'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' |
'extrude' | true/false | Enables or disables extruding the polygon to the ground. |
'tessellate' | true/false | Tesselates the polygon into the ground, so that it will be visible within the terrain contour |
'timeStamp' | kml date string | Associates the polygon 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 polygon 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 polygon 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 two rings around the earth t = linspace(0,360,50); for i = 1:numel(t)-1; k.poly3([t(i) t(i+1) t(i+1) t(i) t(i)],[0 0 1 1 0]+5, [1 1 3 3 1]*1e6,'polyColor','BB00FF00','extrude',false,'lineWidth',0) k.poly3([t(i) t(i+1) t(i+1) t(i) t(i)],[0 0 1 1 0]-5, [1 1 3 3 1]*1e6,'polyColor','BB00FF00','extrude',false,'lineWidth',0) end % 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)