<div dir="ltr">Thanks a lot Moritz..!!!!!!!<div><br></div><div>I got it and I'll read the mapcalc manual as well.</div><div><br></div><div>Thanks again</div><div>Best regards</div><div>Kalindu Perera</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, 26 Oct 2018 at 13:25, Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Am 26. Oktober 2018 09:08:11 MESZ schrieb Kalindu Perera <<a href="mailto:kkc199408@gmail.com" target="_blank">kkc199408@gmail.com</a>>:<br>
>Thanks a lot Moritz....!!!!!!!!<br>
><br>
>Can you just send me one example command?..I'm not sure I understood it<br>
>in<br>
>the way that you explained<br>
<br>
Please do read the r.mapcalc manual, but here's an example:<br>
<br>
r.mapcalc "category_range = if(spread_time_observed >= 1 && spread_time_observed <= 90<br>
 , 1,  null())"<br>
<br>
If there are no values below 1 in spread_time_observed, then this can be simplified to<br>
<br>
r.mapcalc "category_range = if(spread_time_observed <= 90<br>
 , 1,  null())"<br>
<br>
The result of each command is a map with pixel values of 1 where the condition is met and null where not.<br>
<br>
Moritz<br>
<br>
><br>
>Thanks again for the quick reply<br>
>Best regards<br>
>Kalindu Perera<br>
><br>
>On Fri, 26 Oct 2018 at 11:46, Moritz Lennert<br>
><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>><br>
>wrote:<br>
><br>
>><br>
>><br>
>> Am 26. Oktober 2018 06:42:44 MESZ schrieb Kalindu Perera <<br>
>> <a href="mailto:kkc199408@gmail.com" target="_blank">kkc199408@gmail.com</a>>:<br>
>> >Dear all,<br>
>> ><br>
>> >I'm doing wildfire simulations in the Grass. I need to calculate the<br>
>> >area<br>
>> >of only the wildfire spread from the simulation. For that, I need to<br>
>> >take<br>
>> >only the wildfire spread as a separate layer. But the drawback is<br>
>the<br>
>> >values of the cells in the spread is different from point to point.<br>
>But<br>
>> >it<br>
>> >has a range. As an example, the values of cells inside the spread<br>
>are<br>
>> >ranging from 1-90. The other cells in the map show values more than<br>
>> >that.<br>
>> >Can I write a mapcalc command for a range like this to output these<br>
>> >cells<br>
>> >as one layer?<br>
>> ><br>
>> >@Nikos has sent me this mapcalc command and from that, we can take<br>
>only<br>
>> >cells with one value as a layer.<br>
>> ><br>
>> >r.mapcalc "category_3 = if(spread_time_observed == 3, 3, null())"<br>
>> ><br>
>> >instead of that one value(3) in this can we input a range as<br>
>> >above(1-90)<br>
>> >and get all those cells with different values as one layer?<br>
>><br>
>> You can use >/< and the && (logical AND) to select all pixels within<br>
>a<br>
>> range in r.mapcalc.<br>
>><br>
>> But you could also use r.reclass or r.recode.<br>
>><br>
>> Moritz<br>
>><br>
</blockquote></div>