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

NASAHARA Kenlo 24dakenlo at gmail.com
Sun Jan 14 19:32:27 PST 2018


Sorry, I found that it is avoided by "-a" option.

It is described in the manual.
"If the user really wants the raster elevation map resampled to 
the current region resolution, the -a flag should be specified. "
https://grass.osgeo.org/grass73/manuals/r.slope.aspect.html

Kenlo Nasahara

On Mon, 15 Jan 2018 12:28:41 +0900
NASAHARA Kenlo <24dakenlo at gmail.com> wrote:

> 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


-- 
奈佐原 顕郎 (旧姓西田)
筑波大学生命環境系
〒305-8572 つくば市天王台1-1-1
電話・FAX: 029-853-4897

Kenlo Nishida Nasahara
Faculty of Life and Environmental Sciences
University of Tsukuba, Japan 305-8572
24dakenlo at gmail.com


More information about the grass-user mailing list