<html><head></head><body><div class="ydp6059d646yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
<div dir="ltr" data-setdir="false">Hi Vero,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Thanks for the suggestion.</div><div dir="ltr" data-setdir="false">I tried it, but it only gives different weights to the values within the neighborhood according to a distance decay function. However, the values are still determined "deterministically".</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">What I could do is to use the function terra::focal() in R, since within it I can define a function to be computed for the neighborhood and use sample() to make this operation probabilistic. It seems to work, but it quite time consuming though.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Best</div><div dir="ltr" data-setdir="false">Bernardo</div><div><br></div>
</div><div id="yahoo_quoted_3843765528" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
Em segunda-feira, 26 de dezembro de 2022 16:13:02 GMT+1, Veronica Andreo <veroandreo@gmail.com> escreveu:
</div>
<div><br></div>
<div><br></div>
<div><div id="yiv6133300681"><div><div dir="ltr"><div>Hello Bernardo, <br clear="none"></div><div><br clear="none"></div><div>I haven't tested myself, but have you tried r.neighbors with the different weight-related options?</div><div><br clear="none"></div><div>Vero<br clear="none"></div></div><br clear="none"><div class="yiv6133300681gmail_quote"><div dir="ltr" class="yiv6133300681gmail_attr">El mié, 14 dic 2022 a las 10:38, Bernardo Santos via grass-user (<<a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:grass-user@lists.osgeo.org" target="_blank" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>>) escribió:<br clear="none"></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;" class="yiv6133300681gmail_quote"><div id="yiv6133300681yqt57336" class="yiv6133300681yqt0158537235"><div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div dir="ltr">Hi,</div><div dir="ltr"><br clear="none"></div><div dir="ltr">I am trying to produce scenarios of past land cover, before hydropower reservoirs were built. To do so, I need to fill empty pixels from a raster in the locations where the reservoirs are currently present, using as input the actual land cover map. I tried doing that with <font face="courier new, courier, monaco, monospace, sans-serif">r.neighbors</font> (taking method=mode) with neighborhoods of increasing size, to replace null pixels with the most common land cover class in the neighborhood. I also tried that with <font face="courier new, courier, monaco, monospace, sans-serif">r.fill.stats</font> which is basically the same thing.</div><div dir="ltr">However, the results gets very homogeneous, since the interpolated null cells always get the value of the most common land cover class.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Do anyway know of a method in GRASS to perform a "probabilistic" neirighborhood analysis, where cells in a neighborhood are given weights (possibly related to the distance to the central cell and to their frequency) and these weights are used to stocastically sample a value to fill the central cell?</div><div dir="ltr">If not in GRASS, does anyway know of such a method in a different platform, i.e. R?</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Thanks!</div><div dir="ltr">Best</div><div dir="ltr">Bernardo</div></div></div></div>_______________________________________________<br clear="none">
grass-user mailing list<br clear="none">
<a rel="nofollow noopener noreferrer" shape="rect" ymailto="mailto:grass-user@lists.osgeo.org" target="_blank" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br clear="none">
<a rel="nofollow noopener noreferrer" shape="rect" target="_blank" href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br clear="none">
</blockquote></div>
</div></div></div>
</div>
</div></body></html>