[GRASS-user] third raster -> as a function of two input raster (r.series?)

Ciao grass users.

I have two raster.

1) raster 1:
n: 2728570
minimum: -0.791045
maximum: 0.774648
range: 1.56569
mean: 0.138333
mean of absolute values: 0.185515
standard deviation: 0.158265
variance: 0.025048
variation coefficient: 114.409 %
sum: 377452.4525757029

2) raster 2:
n: 2645080
minimum: -141.448
maximum: 88.4339
range: 229.882
mean: -0.00535481
mean of absolute values: 20.1545
standard deviation: 23.7113
variance: 562.226
variation coefficient: -442804 %
sum: -14163.8968614182

I would like in output a third raster that contains only the areas that have
high values of the first raster and with high values of the second raster
(and with the areas that have low values of the first raster and low values
of the second raster). Obviously the scale of values are different.
To do this I thought of using r.series or r.statistics but perhaps is not
the right solution.
Help / advice?

Thanks

Gabriele

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/third-raster-as-a-function-of-two-input-raster-r-series-tp6067501p6067501.html
Sent from the Grass - Users mailing list archive at Nabble.com.

"Gabriele N." says:

I have two raster.

I would like in output a third raster that contains only the areas that

have high values of the first >raster >and with high values of the second
raster (and with the areas that have low values of the first >raster >and
low values of the second raster). Obviously the scale of values are
different.

To do this I thought of using r.series or r.statistics but perhaps is not

the right solution.

Help / advice?

Hey,

I would say the best solution is to use r.mapcalc. With it you are free to
do all kinds of reasoning with respect to both maps.
It seems to me that you want a classified raster, for instance, with 1 for
low values in raster1 and raster2, 3 for high values in both rasters and 2
for everything else. So obviously, you first need at least two thresholds in
order to define what is low and high in each raster, regarding your specific
analysis. Then you would simply do:

r.mapcalc "output_raster=if(raster1<threshold1 &&
raster2<threshold2,1,if(raster1>threshold1 && raster2>threshold2,3,2))"

Look at r.mapcalc with g.manual and in the web, because there is plenty of
material and it is very powerful.

Hope it helps,
Marcello.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/third-raster-as-a-function-of-two-input-raster-r-series-tp6067501p6067611.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Ciao Marcello.

I thought there was another solution but I adopted the solution proposed by
you.

Thank you very much

Gabriele

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/third-raster-as-a-function-of-two-input-raster-r-series-tp6067501p6068331.html
Sent from the Grass - Users mailing list archive at Nabble.com.