r.slope.aspect problem?

NASAHARA Kenlo <[email protected]>
Newsgroups gmane.comp.gis.grass.user
Message-ID <[email protected]>
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
[email protected]

_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user
1.jpg (image/jpeg, 29.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.