Visualization of 2D polygons parallel to the Earth's surface.
Draws polygons at coordinates specified by vectors 'X' and 'Y'. Coordinates belonging to different polygons should be separated by NaNs. Unclosed polygons are closed by default if they consist of 3 or more points. By default the polygon color and polygon outline will be fully opaque white.
In addition to the above, this syntax also allows for specification of a number of parameters regarding the appearance of the polygon when viewed in Google Earth. 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 for ge_poly(). 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.
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. Altitudes are in meters.
See the demo file demo_ge_poly for more details.
The source code below constitutes an example of how ge_poly() may be used.
angleRad = linspace(0,2*pi,6);
pentaX = [4*sin(angleRad);sin(angleRad+pi*0.2)];
pentaY = [4*cos(angleRad);cos(angleRad+pi*0.2)];
x = pentaX(:);
y = pentaY(:);
X = [];
Y = [];
for p=-25:6:25
X=[X;NaN;x+p];
Y=[Y;NaN;y+p];
end
kmlStr = ge_poly(X,Y,'polyColor','FF000000',...
'lineColor','FF00FF00',...
'lineWidth',2);
ge_output('example_ge_poly.kml',kmlStr)
The above will generate a *.kml file that looks like the image below when opened in the Google Earth viewer.
