function [output] = ge_polyplace(X, Y, blPlace, varargin)
error('%s has been deprecated',mfilename)
% Reference page in help browser:
%
% link to html documentation
% show license statement
%
AuthorizedOptions = authoptions( mfilename );
id = 'polyplace';
idTag = 'id';
name = 'ge_polyplace';
description = '';
timeStamp = ' ';
timeSpanStart = ' ';
timeSpanStop = ' ';
visibility = 1;
lineColor = 'ffffffff';
polyColor = 'ffffffff';
lineWidth = 1.0;
snippet = ' ';
altitude = 1.0;
extrude = 1;
tessellate = 0;
altitudeMode = 'clampToGround';
msgToScreen = false;
region = ' ';
parsepairs %script that parses Parameter/Value pairs.
if msgToScreen
disp(['Running :',mfilename,'...'])
end
if ( isempty( Y ) || isempty(X) )
error('empty coordinates passed to ge_box(...).');
elseif length(Y) ~= length(X)
error('Length of Y is different to length of X');
end
if ~(isequal(altitudeMode,'clampToGround')||...
isequal(altitudeMode,'relativeToGround')||...
isequal(altitudeMode,'absolute'))
error(['Variable ',39,'altitudeMode',39, ' should be one of ' ,39,'clampToGround',39,', ',10,39,'relativeToGround',39,', or ',39,'absolute',39,'.' ])
end
if region == ' '
region_chars = '';
else
region_chars = [ region, 10 ];
end
id_chars = [ idTag '="' id '"' ];
poly_id_chars = [ idTag '="poly_' id '"' ];
name_chars = [ '',10, name,10, '',10 ];
description_chars = [ '',10,'',10,'',10 ];
visibility_chars = [ '',10, int2str(visibility),10, '',10 ];
lineColor_chars = [ '',10, lineColor ,10,'',10 ];
polyColor_chars = [ '',10, polyColor ,10,'',10 ];
lineWidth_chars= [ '',10, num2str(lineWidth, '%.2f'),10, '',10 ];
altitudeMode_chars = [ '',10, altitudeMode ,10,'',10 ];
if snippet == ' '
snippet_chars = '';
else
snippet_chars = [ '' snippet '',10 ];
end
extrude_chars = [ '' int2str(extrude) '',10 ];
tessellate_chars = [ '' int2str(tessellate) '',10 ];
if timeStamp == ' '
timeStamp_chars = '';
else
timeStamp_chars = [ '' timeStamp '',10 ];
end
if timeSpanStart == ' '
timeSpan_chars = '';
else
if timeSpanStop == ' '
timeSpan_chars = [ '' timeSpanStart '',10 ];
else
timeSpan_chars = [ '' timeSpanStart '' timeSpanStop '',10 ];
end
end
header = ['',10, ...
name_chars, ...
timeStamp_chars,...
timeSpan_chars,...
visibility_chars, ...
snippet_chars, ...
description_chars, ...
region_chars, ...
'',10,...
'',10, ....
extrude_chars, ...
altitudeMode_chars, ...
'',10, ...
extrude_chars, ...
'',10, ...
extrude_chars, ...
tessellate_chars, ...
altitudeMode_chars, ...
'',10];
footer = ['',10, ...
'',10, ...
'',10, ...
'',10, ...
'',10];
latnans = isnan(Y);
nPolygons = sum(latnans);
polyIdx = find( latnans > 0 );
idx = 1;
output = '';
for x = 1:nPolygons
pre_header = '';
if blPlace
%placemark in centroid
pre_header = ['',10, ...
name_chars, ...
timeStamp_chars,...
timeSpan_chars,...
description_chars, ...
'',10, ...
extrude_chars,...
altitudeMode_chars, ...
'' ...
sprintf('%.6f,%.6f,%.6f ', mean(X(idx:(polyIdx(x)-1))), mean(Y(idx:(polyIdx(x)-1))), mean(altitude)) ...
'',10,...
'',10, ...
'',10];
end %if
%generate Coords
coordinates = [];
for i=idx:(polyIdx(x)-1)
coordinates = [ coordinates, ...
sprintf('%.6f,%.6f,%.6f ', X(i), Y(i), altitude)];
end %for
idx = i+2;
coordinates = [ coordinates, 10];
output = [ output, pre_header, header, coordinates, footer];
end
if msgToScreen
disp(['Running ',mfilename,'...Done'])
end