Documentation of landfill


Global Index (short | long) | Local contents | Local Index (short | long)


Function Synopsis

hh = landfill(elev);

Help text


  h = landfill(elev);

  elev = elevation of patches 


Cross-Reference Information

This function calls

Listing of function landfill

function hh = landfill(elev);

if nargin == 0; elev = -10000; end

ll = coast;
tem = ll(:,2); tem(tem<0) = tem(tem<0)+360.;
ll(:,2) = tem;
%global x_coasts y_coasts
xl = getm(gca, 'maplonlimit'); yl = getm(gca, 'maplatlimit');

x0=xl(1); x1=xl(2); y0=yl(1); y1=yl(2);

xtmp = ll(:,2)'; ytmp = ll(:,1)';
xy = find( ~(isinrange(xtmp,xl) & isinrange(ytmp,yl)) );
xtmp(xy)=nan*ones(size(xy)); ytmp(xy)=nan*ones(size(xy));
x = [ x nan xtmp ]; y = [ y nan ytmp ];
tem = intersect(find(isnan(x)), find(isnan(y)));
tem = diff(tem);

x = ll(:,2)'; y = ll(:,1)';
xtmp = []; ytmp = [];
doisnan = 1;
for i = 1:length(x);
  if isnan(x(i)) & doisnan;
    xtmp = [xtmp NaN]; ytmp = [ytmp NaN];
    doisnan = 0;
  end
  if ~isnan(x(i));
    if (isinrange(x(i), xl) & isinrange(y(i), yl));
      xtmp = [xtmp x(i)]; ytmp = [ytmp y(i)];
      doisnan = 1;
    else
      if doisnan;
	xtmp = [xtmp NaN]; ytmp = [ytmp NaN];
        doisnan = 0;
      end
    end
  end
end



%  Remove indices outside of the limits
    x = []; y = [];
    nt1 = floor((x0+180)/360); nt2 = floor((x1+180-1.e-9)/360);
    for it = nt1:nt2;
      xtmp=ll(:,2)'+it*360; ytmp=ll(:,1)';
%      xtmp=x_coasts+it*360; ytmp=y_coasts;
      xy = find ( ~(isinrange(xtmp,xl) & isinrange(ytmp,yl)) );
      xtmp(xy)=nan*ones(size(xy)); ytmp(xy)=nan*ones(size(xy));
      xtmp = xtmp - it*360;
      x = [ x nan xtmp xtmp(1) ]; y = [ y nan ytmp ytmp(1) ];
    end;

hh = fill3m(y, x, 1, [0.9 0.9 0.9])

%h = displaym(worldlo('POpatch'));
%set(h, 'Facecolor', 0.8*[1 1 1]);
%set(h, 'Edgecolor', 0.8*[1 1 1]);

for i = 1:length(h);
  tem = get(h(i), 'ZData');
  tem = tem+elev;  %  Here just use any number that is larger than the 
                 %  maximum height of your contoured data         
  set(h(i), 'ZData', tem);
end