[GRASS-user] Slope categories from DEM ?
Emma
emma at seleeg.org
Sat Nov 6 17:24:27 EDT 2010
Dear all,
Thanks a lot for your answers. I tried the following:
----------------
1.
r.slope.aspect elevation=new_dem slope=new_slope format=degrees
2.
r.reclass input=new_slope output=new_slope_30 rules=grassrule.txt
where grassrule.txt contained:
1 thru 30 = 1
31 thru 90 = 2
----------------
This works pretty well and the result corresponds to what I wanted.
Great !!
Now I also tried to use r.mapcalc instead of r.reclass as follows:
r.mapcalc 'new_slope_30_bis = if(new_slope > 30, 1, 0)'
However for some reason the resulting map new_slope_30_bis has:
Rows: 20
Columns: 20
Total Cells: 400
while the original new_slope, as well as new_slope_30 have both Total
Cells: 47212692. So you can imagine the result is not very nice...
Why is this happening ? (and am I allowed to attach screenshots to my
emails in this mailing list??)
Sincerely yours,
Emma
On 6-Nov-10, at 10:08 PM, Rich Shepard wrote:
> On Sat, 6 Nov 2010, Daniel Victoria wrote:
>
>> So, by reversing the test in the if statement will give you values
>> of 1
>> for low slope areas.
>
> In the question asked to start this thread, there's apparently no
> interest
> in values == 30%. By default, those are included in the false
> category. And
> if one wants them included in the true category the test condition
> needs to
> be <= rather than just <.
>
> Rich
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
More information about the grass-user
mailing list