[GRASS-user] r.mapcalc and producing a max value map

Michael Barton michael.barton at asu.edu
Mon Jul 14 11:09:30 EDT 2008


____________________
C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>



On Jul 14, 2008, at 6:32 AM, <grass-user-request at lists.osgeo.org> wrote:

> Date: Mon, 14 Jul 2008 15:22:03 +0200
> From: Christian Schwartze <Christian.Schwartze at uni-jena.de>
> Subject: [GRASS-user] (no subject)
> To: grass-user at lists.osgeo.org
> Message-ID: <1216041723.487b52fbc1998 at webmail.uni-jena.de>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Dear GRASS users,
>
> could somebody help me to find some solution for the following task?
> I have a raster map representing many distinct areas (MAP_1) and a  
> second int
> raster with specific values (MAP_2). The result map should contain  
> the same
> areas of MAP_1 but with the max MAP_2 value of each area as IDs. I  
> tried some
> approaches with r.mapcalc but I don't know how to code the region  
> aspect of
> MAP_1 into r.mapcalc.
>
> 	MAP_1		MAP_2		--->	MAP_MAX
> 	-----		-----			-------
>
> 	1111333332	5266723974		7777999995
> 	1113333222	1429784155	--->	7779999555
> 	1113333322	4152763923		7779999955
> 	1111144442	4125718443		7777788885
>

Christian,

I think what you need is the following:

r.statistics base=map_1 cover=map_2 method=max output=map_max

Michael


More information about the grass-user mailing list