<div dir="ltr">Five million cells isn't all that many, how slow is too slow? Buffering a raster of about 10 million cells on my laptop takes on the order of 20 seconds or so for a binary raster. Is it possible that you're fighting memory problems?<div><br></div><div>In the past when doing multiple ring buffers I've found it faster to calculate a distance-to raster first, and then apply multiple logical comparisons on the distance raster. I don't know if this applies to your situation or not but it's one trick that might help.</div><div><br></div><div>Sincerely,</div><div>Forrest<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 11, 2016 at 10:58 AM Nelly Reduan <<a href="mailto:nell.redu@hotmail.fr">nell.redu@hotmail.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;background-color:rgb(255,255,255)">
<p><span></span></p>
<p>Hello,</p>
<p><br>
</p>
<p>I would like to build 100-m buffers (representing ecological corridors) around land cover attributes in a raster layer and to assign a given value (i.e., value of 13) to buffer cells.</p>
<p><br>
</p>
<p>To do this, I'm using the function "buffer" (package raster) to draw the buffers around particular raster cells (i.e., cell values of 2 and 5). For example, in the image below, the buffers are represented in blue (cell values of 13) and the particular raster
cells are represented in yellow (cell values of 2).</p>
<p><br>
</p>
<p>The problem is that the time to run the function "buffer" is very low because I have a raster of 5000000 cells. Does anyone know how I can reduce the buffering time ?</p>
<p><br>
</p>
<p>Thanks a lot for your time.</p>
<p>Have a nice day.</p>
<p>Nell</p>
<span></span><br>
<p></p><img src="cid:154060fc7216d0e7b411" alt="Capture.PNG" class="GQ" style="max-width: 100%;"><p></p>
</div>
</div>
_______________________________________________<br>
R-sig-Geo mailing list<br>
<a href="mailto:R-sig-Geo@r-project.org" target="_blank">R-sig-Geo@r-project.org</a><br>
<a href="https://stat.ethz.ch/mailman/listinfo/r-sig-geo" rel="noreferrer" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-geo</a></blockquote></div></div></div>