<div dir="ltr">Dear Maning,<div><br></div><div>Many thanks for your kindly attention.</div><div><br></div><div>I tryed your suggestion and notice that the F8 solution</div><div>simulate a dilatation of 1pixels on everyside of patches.</div>
<div>But, if I am not wrong, when I have a patch separated by</div><div>2 pixels, the F8 solution will join these patches on only one.</div><div><br></div><div>But I can preserve the patches separated, and only </div><div>
consider as one patches those pixels that can be joined</div><div>on the rule 8. I donīt know if I am so clear, but I would </div><div>like to request a little more time of you on this regard.</div><div><br></div><div>I run the folowwing commands:</div>
<div><br></div><div><div>r.mapcalc "F8 = (A*A[-1,-1]) * (A*A[-1,0]) * (A*A[1,-1]) * (A*A[0,-1]) * (A*A[0,1]) * (A*A[-1,1]) * (A*A[1,1])"</div><div>r.clump input=F8 output=F8_clump</div><div><br></div></div><div>
Best wishes,</div><div><br></div><div>miltinho</div><div><br><div class="gmail_quote">2008/9/14 maning sambale <span dir="ltr"><<a href="mailto:emmanuel.sambale@gmail.com" target="_blank">emmanuel.sambale@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I used to implement an r.mapcalc script by evaluating values in the<br>
cardinal directions<br>
<br>
sample below:<br>
## pixels with both forest from the cardinal directions<br>
# 0--x--0<br>
# | | |<br>
# x--x--x<br>
# | | |<br>
# 0--x--0<br>
<br>
r.mapcalc "F4 = (A * A [1,0]) * (A * A [-1,0]) * (A * A [0,-1]) * (A * A [0,1])"<br>
<br>
where [r,c] refers to the current cell offset<br>
<br>
for an 8-rule you can use<br>
<br>
[-1,-1],[-1,0],[1,-1],[0,-1],[0,1],[-1,1],[1,-1],-1,1]<br>
<br>
hope that helps.<br>
<br>
cheers,<br>
maning<br>
<div><div></div><div><br>
On 9/15/08, Milton Cezar Ribeiro <<a href="mailto:miltinho.astronauta@gmail.com" target="_blank">miltinho.astronauta@gmail.com</a>> wrote:<br>
> Dear all,<br>
> I am using r.cluster to identify the clumps of pixels of my binary map<br>
> (0=matrix and 1=habitat).<br>
> But when I run r.cluster, I get and output cluster map as (B) (see below)<br>
> and in fact<br>
> I would like the those diaagonal patches were clumped as the same clump.<br>
> Almost to those that work with landscape ecology, the patches are formed<br>
> using rules with 8 neighbors intead of 4 neighbors.<br>
><br>
> I know that I can do it on other programs, but I need to implement a<br>
> sequence of<br>
> codes on GRASS, and I really need a rule-8 to build my patches map. Any<br>
> idea?<br>
><br>
> Best wishes,<br>
><br>
> miltinho astronauta<br>
> brazil<br>
><br>
> (A)<br>
> 00000000<br>
> 01000000<br>
> 00110000<br>
> 00110000<br>
> 00001100<br>
> 00001100<br>
> 00001100<br>
> 00000000<br>
> (B)<br>
> 00000000<br>
> 01000000<br>
> 00220000<br>
> 00220000<br>
> 00003300<br>
> 00003300<br>
> 00001100<br>
> 00000000<br>
><br>
<br>
<br>
</div></div><font color="#888888">--<br>
|---------|----------------------------------------------------------|<br>
| __.-._ |"Ohhh. Great warrior. Wars not make one great." -Yoda |<br>
| '-._"7' |"Freedom is still the most radical idea of all" -N.Branden|<br>
| /'.-c |Linux registered user #402901, <a href="http://counter.li.org/" target="_blank">http://counter.li.org/</a> |<br>
| | /T |<a href="http://esambale.wikispaces.com" target="_blank">http://esambale.wikispaces.com</a>|<br>
| _)_/LI<br>
|---------|----------------------------------------------------------|<br>
</font></blockquote></div><br></div></div>