At 09:42 PM 12/5/01 -0700, RandaEnt. wrote:
>Is there a slick way to convert v2.5 %slope values to v2.6 values?

I am assuming v2.5 %slope values are computed in the way related by Bill 
Thoen on this list a few days ago:

>The "unofficial" explanation (from a while ago) is this:
>
> >> "We calculate slope the same way everyone else does. Rise over Run. 
> What people don't realize is that calculating the slope of a grid cell is 
> not that simple. The slope of the cell depends on the cells around it. It 
> is possible to draw 8 triangles between the centre of a particular cell, 
> and the centres of the cells surrounding it. We calculate the slope by 
> figuring out the slope of each of these eight triangles, and then 
> averaging the result.

Below I will refer to this as the "VM" method.

I am also assuming the v2.6 values are something reasonable.  To be 
concrete, I will be using the ordinary least squares (OLS) fit of a plane 
to the grid at a cell, using the cell's value and the values of its eight 
nearest neighbors.  Below I will refer to this as the OLS method.

The rest of this message analyzes these two methods and compares them, 
theoretically and through simulations.  If you're interested just in the 
conclusions, jump to the bulleted points at the end.

If we choose horizontal and vertical units of measurement in which the cell 
size becomes 1.0 and a datum so that the cell in question is located at 
(0,0), the slopes do not change but the calculations become quite 
simple.  I will let Z(i,j) denote the value at the cell i units to the 
right and j units up from the cell at which the slope is to be estimated.

(VM)            The v2.5 method?  The eight triangles all have the same 
shape, a 45-45-90 triangle.  We can say such triangles have two "points" 
and one "base" [point] located at the 90 degree angle.  One of these 
triangles, for example, has vertices at (0,0), (1,0), and (1,1), with 
corresponding cell values Z(0,0), Z(1,0) and Z(1,1).  The slope of this 
triangle is sqrt([Z(0,0)-Z(1,0)]^2 - [Z(1,1)-Z(1,0)]^2).   In words, one 
forms the two differences of values between each point and the base point, 
then computes the square root of the sum of squares of these 
differences.  Do this for all eight triangles and average.

(OLS)   The v2.6 method?  The OLS solution is much simpler.  Compute the 
three differences in the X direction: dZ(-1) = Z(1,-1) - Z(-1,-1), dZ(0) = 
Z(1,0) - Z(-1,0), and dZ(1) = Z(1,1) - Z(-1,1).  Add them up and divide by 
6.  This is the X-component of the gradient of the surface.  The 
Y-component is computed in a similar manner.  The OLS slope is the square 
root of the sum of squares of the gradient components.

These recipes sound similar, but they are not.  One obvious difference is 
that every term in VM includes a comparison of Z(0,0) with a neighboring 
value, whereas the OLS formula does not even involve Z(0,0)--which is the 
grid value at the cell in question!  Formula (VM) is akin to a measure of 
local variation, kind of like a standard deviation.  Formula B is a slope 
estimate derived from a well-known, unbiased planar fit to the grid 
surface.  There is a very important conceptual difference: especially with 
noisy data--which almost all real data are--the slope represents the 
general trend of the data whereas the standard deviation (actually the 
variance) can be decomposed as the sum of the general trend PLUS all 
second-order and higher variation PLUS any random noise.  Therein lies the 
problem with (VM) and the heart of the difficulty in relating the two results.

(There is an important practical difference, too: computing formula (VM) 
will take about eight times longer than computing formula (OLS), largely 
because of the cost of extracting square roots.)

For instance, near an isolated extreme value (top of a peak, bottom of a 
bowl, or saddle point: a mountain pass, for example), the slope formula 
(OLS) will typically give near-zero values but formula (VM) will give 
values related to the *curvature* near the point, which could be quite large.

For this reason we can expect the two formulas to give similar results ONLY 
where (i) the slope is large and (ii) the surface is fairly flat and not 
curving rapidly from cell to cell and (iii) there's not a lot of 
spatially-uncorrelated noise in the data.  In all the other cases, we 
should expect VM to give worse slope estimates than OLS on the average.

To verify these expectations I ran some simulations.  A few were to 
designed to elicit the expected differences, and a few more were designed 
to reproduce a typical GIS application using a USGS 1:24,000 DEM (cell size 
30 feet, contour interval 10 feet, estimated local relative elevation 
uncertainty around +-1 foot).  Here are the results:

*       For true slopes of zero, OLS and VM consistently give positive 
values (they can't give negative ones!), but OLS averages about one-third 
the VM value, which makes it three times as good.  Moreover, there is ZERO 
correlation among the two methods.  Furthermore, it does not matter how 
much noise is in the data.  In other words, very clean, accurate elevations 
will cause both OLS and VM to give results closer to zero, but OLS is still 
three times as good as VM on the average and the two methods are still 
entirely uncorrelated.

*       For true slopes near ten percent and realistic values of noise (as 
suggested by USGS metadata), the OLS and VM results are correlated decently 
(R-squared runs as high as 70-80%).  However, the VM results are 
consistently biased high: for "white noise" with sd=1 foot (=1/30 of the 
cell size), the VM estimates average 11.2% whereas OLS averages 10.1%.  The 
high bias of slightly more than one foot in VM is in close agreement with 
the actual one-foot inaccuracy built into the simulation.  The VM results 
are slightly more variable than the OLS results, too, due to their higher 
sensitivity to noise in the data.


CONCLUSIONS
----------------------

*       For accurate data, where VM computes largish slopes, the correct 
slope value will be slightly less on average.  How much less depends on the 
actual surface ruggedness at each point.  In short, VM is biased high.  (So 
is OLS, but not by anywhere near as much.)

*       For accurate or inaccurate data, where VM computes low slopes (say 
5% or less in typical applications), then watch out: the slopes may 
actually be much lower (or higher).  There will be no correlation whatever 
with the better OLS estimate.

*       For inaccurate or noisy data, or grids that have high, non-linear 
local variation, the VM computation only gives a not-very-good upper bound 
on the true slope.

*       There's nothing to be gained by smoothing the VM estimates and 
comparing them to the OLS estimates, because the high bias built into VM 
will remain.

*       Computing slopes is easy and fast--if you do it right.

Briefly, you're much better off computing the slopes correctly than in 
trying to fix any VM slopes you may have computed.  Go back to the original 
grid and do it right.


RandaEnt. further inquired,

>It would seem that most everyone would want v2.6 methods to be used?

Unless you really have a need for some weird combination of slope, 
curvature, and local variability, you certainly don't want to use the VM 
method.

Remember, any conclusions to be drawn about v2.5 versus v2.6 depend on 
whether I'm correct in the supposition that v2.5 uses VM and v2.6 uses 
something like OLS.  Perhaps a more knowledgeable lister could fill us in 
on that?

Cheers,
Bill Huber
www.quantdec.com



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to