[GRASS-user] Exporting set of raster cells with different values as one layer

Moritz Lennert mlennert at club.worldonline.be
Thu Oct 25 23:16:36 PDT 2018



Am 26. Oktober 2018 06:42:44 MESZ schrieb Kalindu Perera <kkc199408 at gmail.com>:
>Dear all,
>
>I'm doing wildfire simulations in the Grass. I need to calculate the
>area
>of only the wildfire spread from the simulation. For that, I need to
>take
>only the wildfire spread as a separate layer. But the drawback is the
>values of the cells in the spread is different from point to point. But
>it
>has a range. As an example, the values of cells inside the spread are
>ranging from 1-90. The other cells in the map show values more than
>that.
>Can I write a mapcalc command for a range like this to output these
>cells
>as one layer?
>
>@Nikos has sent me this mapcalc command and from that, we can take only
>cells with one value as a layer.
>
>r.mapcalc "category_3 = if(spread_time_observed == 3, 3, null())"
>
>instead of that one value(3) in this can we input a range as
>above(1-90)
>and get all those cells with different values as one layer?

You can use >/< and the && (logical AND) to select all pixels within a range in r.mapcalc.

But you could also use r.reclass or r.recode.

Moritz


More information about the grass-user mailing list