[GRASS-user] r.slope.aspect problem?

NASAHARA Kenlo 24dakenlo at gmail.com
Sun Jan 14 19:28:41 PST 2018


Dear GRASS experts:

I report a strange behavior of GRASS 7.0.3 on Ubuntu 16.04.
It happens in r.slope.aspect. When I tried to create a 
slope map using a resolution bigger than the original DEM's
resolution, the result becomes strange. 

Here is a simple example (please look at the code at the
end of this e-mail). First, it creates an imaginary DEM
on which "elevation" is a column number in 100 pix x 100 pix
region of 0N~1N, 0E~1E . It is called testdem.

Using that DEM, r.slope.aspect gives right answer 
(test_slope =0.51 deg. It is equal to atan (100 m/((40000000 m)/360)).
Please take a look at the attached picture.

However, after setting the resolution twice as big  (0.02 deg) as 
the original one (0.01 deg), r.slope.aspect happens to give a 
wrong answer (test_slope1 =0.0257, which is ohe-half of the right answer).

However, when I resample the original DEM by r.mapcalc 
command, and try r.slope.aspect command using the 
resampled DEM (called test_dem2), this time it gives right 
answer (test_slope =0.51 deg).

Obviously these three results should be the same because the
original DEM is a homogeneous slope.

I suspect something wrong in the treatment of resolution in
r.slope.aspect commands.

(code)
g.region w=0 e=1 s=0 n=1 rows=100 cols=100
r.mapcalc expression="testdem=col()" --o
r.slope.aspect elevation=testdem slope=test_slope0 --o
g.region res=0.02
r.slope.aspect elevation=testdem slope=test_slope1 --o
r.mapcalc expression="testdem2=testdem" --o
r.slope.aspect elevation=testdem2 slope=test_slope2 --o
d.mon wx0
d.rast test_slope0
d.rast test_slope1
d.rast test_slope2


---------------
Kenlo Nishida Nasahara
Faculty of Life and Environmental Sciences
University of Tsukuba, Japan 305-8572
24dakenlo at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.jpg
Type: image/jpeg
Size: 29902 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180115/70c9fd86/attachment-0001.jpg>


More information about the grass-user mailing list