<br><br>G. Allegri wrote:<br><div class="gmail_quote"><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><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>