On 27/05/2013 22:36, Marcello Benigno wrote:
Hi Micha,

About:

Not sure I understand the logic of taking the highest value

This was defined by an agronomist, I also do not understand why =/

However, your answer is exactly what I need, did not know r.series, thank you!

If you can help me also in this tip, I would be very grateful, I'm reclassifying the slope as follows:

r.mapcalc class_1 = 'if(slope <= 2.0, 1, null())'
r.mapcalc class_2 = 'if(2.0 < slope <= 5, 2, null())'
r.mapcalc class_3 = 'if(5 < slope <= 10, 3, null())'
r.mapcalc class_4 = 'if(10 < slope <= 15, 4, null())'
r.mapcalc class_5 = 'if(15 < slope <= 45, 5, null())'
r.mapcalc class_6 = 'if(45 < slope <= 70, 6, null())'
r.mapcalc class_7 = 'if(slope > 70, 7, null())'

r.mapcalc slope.reclass = class_1 + class_2 + class_3 + class_4 + class_5 + class_6 + class_7

How do I create a single _expression_ for this problem?

How about using r.reclass ?
Create a text file "slope_reclass.txt" which contains rows:
0 thru 2 = 1
2 thru 5 = 2
5 thru 10 = 3
...
70 thru 100 = 7

then run
r.reclass in=slope out=slope_rc rule=slope_reclass.txt

Be aware that the reclass map is not a "real" raster. If you need to use it for other things, then a second r.mapcalc _expression_ will be necessary to create on on-disk raster map.  Such as:
r.mapcalc slope_reclass=slope_rc

Regards,
Micha


Regards
--
Marcello Benigno B. de Barros Filho
Prof. do Curso Superior de Tecnologia em Geoprocessamento - IFPB
Mestre em Ciências Geodésicas e Tecnologias da Geoinformação - UFPE
Doutorando em Tecnologia Ambiental e Recursos Hídricos - UFPE
http://profmarcello.blogspot.com

This mail was received via Mail-SeCure System.


-- 
Micha Silver
GIS Consulting
052-3665918
http://www.surfaces.co.il

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to