[GRASS-user] calculating average value over a base map

Greetings

I have a map with values and a base map created with r.clump. How can I calculate the average of values that falls inside each cluster defined by r.clump?
Thanks

Best regards,
Monica

Monica,

try to use r.statistics with the average function/method. Pass you maps through the cover= and base= parameters…

Christian.

From: Monica Buescu
Sent: Monday, February 28, 2011 4:27 PM
To: GRASS user list
Subject: [GRASS-user] calculating average value over a base map

Greetings

I have a map with values and a base map created with r.clump. How can I calculate the average of values that falls inside each cluster defined by r.clump?
Thanks

Best regards,
Monica



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

Greetings Christian

Unfortunely it only works with CELL values. For instance, r.median uses more than just CELL.
Is there any other alternative? Beucase for mode and median there is specific functions.

Thamls

Best regards,
Monica

On Mon, Feb 28, 2011 at 3:55 PM, Christian Schwartze <christian.schwartze@uni-jena.de> wrote:

Monica,

try to use r.statistics with the average function/method. Pass you maps through the cover= and base= parameters…

Christian.

From: Monica Buescu
Sent: Monday, February 28, 2011 4:27 PM
To: GRASS user list
Subject: [GRASS-user] calculating average value over a base map

Greetings

I have a map with values and a base map created with r.clump. How can I calculate the average of values that falls inside each cluster defined by r.clump?
Thanks

Best regards,
Monica



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

If you want to deal with raster value types other than CELL, you can use the –c flag in r.statistics in order to process the labels. Therfore, you have to copy your cat values to the category labels first…

Regards,
Christian.

From: Monica Buescu
Sent: Monday, February 28, 2011 5:16 PM
To: Christian Schwartze
Cc: GRASS user list
Subject: Re: [GRASS-user] calculating average value over a base map

Greetings Christian

Unfortunely it only works with CELL values. For instance, r.median uses more than just CELL.
Is there any other alternative? Beucase for mode and median there is specific functions.

Thamls

Best regards,
Monica

On Mon, Feb 28, 2011 at 3:55 PM, Christian Schwartze <christian.schwartze@uni-jena.de> wrote:

Monica,

try to use r.statistics with the average function/method. Pass you maps through the cover= and base= parameters…

Christian.

From: Monica Buescu
Sent: Monday, February 28, 2011 4:27 PM
To: GRASS user list
Subject: [GRASS-user] calculating average value over a base map

Greetings

I have a map with values and a base map created with r.clump. How can I calculate the average of values that falls inside each cluster defined by r.clump?
Thanks

Best regards,
Monica



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

Hello Christian.
I believe I didn’t quite understand what you have said but I think that is not the way.
My basemap is a r.clump output in CELL format that ranges from 1 til 1700 or something
my cover map is NDVI that ranges from -1 (near) til 1 (near) and is a FCELL.

My Objective. calculate for each clump, the average of NDVI pixels

If I do:
r.statistics -c base=new_clump cover=2007_ndvi method=average

I get:
ERROR: This module currently only works for integer (CELL) maps

Is there any alternative to do this?

Thank you Christian and the rest of grass mailing list

Monica

On Mon, Feb 28, 2011 at 5:08 PM, Christian Schwartze <christian.schwartze@uni-jena.de> wrote:

If you want to deal with raster value types other than CELL, you can use the –c flag in r.statistics in order to process the labels. Therfore, you have to copy your cat values to the category labels first…

Regards,
Christian.

From: Monica Buescu
Sent: Monday, February 28, 2011 5:16 PM
To: Christian Schwartze
Cc: GRASS user list
Subject: Re: [GRASS-user] calculating average value over a base map

Greetings Christian

Unfortunely it only works with CELL values. For instance, r.median uses more than just CELL.
Is there any other alternative? Beucase for mode and median there is specific functions.

Thamls

Best regards,
Monica

On Mon, Feb 28, 2011 at 3:55 PM, Christian Schwartze <christian.schwartze@uni-jena.de> wrote:

Monica,

try to use r.statistics with the average function/method. Pass you maps through the cover= and base= parameters…

Christian.

From: Monica Buescu
Sent: Monday, February 28, 2011 4:27 PM
To: GRASS user list
Subject: [GRASS-user] calculating average value over a base map

Greetings

I have a map with values and a base map created with r.clump. How can I calculate the average of values that falls inside each cluster defined by r.clump?
Thanks

Best regards,
Monica



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

Hi DmistrijI think it was worked. I just need to figure out something with r.statistics.

Thanks
Monica

Monica,
I did similar things on slope values…have a look to the following code snippet:

r.mapcalc slope_mult=int(slope1000.0)
r.stats -nN input=slope_mult | awk ‘{print $1"=“$1” "$1/1000}’ | r.reclass --o input=slope_mult output=slope_labeled
r.statistics --o -c base=base_map cover=slope_labeled method=average output=slope_avg
r.mapcalc slope_avg_cval=int(@slope_avg
1000)/1000.0

Perhaps it may help you…
Regards,
Christian.

From: Monica Buescu
Sent: Tuesday, March 01, 2011 11:40 AM
To: Dmitrij Kolesov ; GRASS user list
Subject: Re: [GRASS-user] calculating average value over a base map

Hi DmistrijI think it was worked. I just need to figure out something with r.statistics.

Thanks
Monica



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