---------- Forwarded message ----------
Date: Sun, 27 Aug 2000 02:20:41 CDT
From: Joseph McCollum <[log in to unmask]>
To: [log in to unmask]
Subject: Re: Reference Question Regarding Elevations (fwd)
Get the DEM from the National Geophysical Data Center.
Also they have a county mask.
It would require some coding, but basically it is this:
high = zeros(3200); /* there are something like 3200 counties in
the USA */
low = 10000 * ones(3200);
all = zeros(3200);
count = zeros(3200);
for i = 1:rows,
for j = 1:cols,
c = county(i,j);
e = elev(i,j);
if e > high(c); high(c) = e; endif;
if e < low(c); low(c) = e; endif;
all(c) = sum(all(c),e);
count(c) = sum(count(c),1);
end;
end;
avg = all/count;
This would not get the actual high elevation (or actual low) elevation in
each county. It would get the highest (or lowest) - valued DEM pixel
(itself an average).