OK, sorry for that. So your problem is the famous edge effect that affects us all.<br><br>Well, I think you have a real problem there. <br><br>If you find a good solution, please share.<br><br>Best,<br>Marcello.<br><br><br>
<br><br><br><br><div class="gmail_quote">On Tue, Jun 19, 2012 at 11:39 AM, G. Allegri <span dir="ltr"><<a href="mailto:giohappy@gmail.com" target="_blank">giohappy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Marcello,<div>thanks, but my problem is not finding the border. I already have it (with its own category) but assigning it the value from the surrounding (not null) value, e.g. max/min/etc. </div><div>The problem with kernel filters/moving windows is that they do not filter out null values...</div>
<div><br></div><div>giovanni<div><div class="h5"><br><br><div class="gmail_quote">2012/6/19 Marcello Gorini <span dir="ltr"><<a href="mailto:gorini@gmail.com" target="_blank">gorini@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br>G. Allegri wrote:<br><div class="gmail_quote"><div><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I need to assign values to a the cells on the "border" of a raster. The inside and the outside are distinguished by having or not having null values assigned.<div>
I also need to keep the other cell values (internals) untouched.<br><br></div></blockquote></div><div><br> Hey,<br><br>Check out r.grow. I am pretty sure you can modify the example given in the manual to find the borders of your raster. Something like:<br>
<br># creates an inverted raster from your raster<br>> r.mapcalc "raster_inverted=if(isnull(raster,1,null())"<br># grow this inverted raster by one cell<br>> r.grow in=raster_inverted out=raster_inverted_grown<br>
# now both rasters overlap at the border, so you can do whatever you want with it, for instance, extract it<br>> r.mapcalc "border=if(raster_inverted_grown==1 && isnull(raster)==0,raster,null())"<br>
<br>
Hope it helps.<br><br>Cheers,<br>Marcello.<br><br><pre><br></pre></div></div><br>
</blockquote></div><br></div></div></div>
</blockquote></div><br>