<div dir="ltr">How is your white frames coded?</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Paulo Eduardo Cardoso<br><font size="1"><a href="http://pt.linkedin.com/pub/paulo-e-cardoso/65/291/b99" target="_blank">linkedin</a> | </font><a href="https://github.com/PauloEduardoCardoso" style="font-size:x-small" target="_blank">github</a> | <a href="http://stackoverflow.com/users/640783/paulo-cardoso" style="font-size:x-small" target="_blank">stackoverflow</a> | <font size="1"><a href="https://www.researchgate.net/profile/Paulo_Cardoso9" target="_blank">researchgate</a></font><div>_______________________                                                        </div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2016-03-23 15:06 GMT+00:00  <span dir="ltr"><<a href="mailto:rs-ecology-request@lists.uni-wuerzburg.de" target="_blank">rs-ecology-request@lists.uni-wuerzburg.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send RS-ecology mailing list submissions to<br>
        <a href="mailto:rs-ecology@lists.uni-wuerzburg.de">rs-ecology@lists.uni-wuerzburg.de</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology" rel="noreferrer" target="_blank">https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:rs-ecology-request@lists.uni-wuerzburg.de">rs-ecology-request@lists.uni-wuerzburg.de</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:rs-ecology-owner@lists.uni-wuerzburg.de">rs-ecology-owner@lists.uni-wuerzburg.de</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of RS-ecology digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Problem with merging raster objects (Henrike StB)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 23 Mar 2016 15:26:32 +0100<br>
From: Henrike StB <<a href="mailto:henrikestb@gmail.com">henrikestb@gmail.com</a>><br>
To: <a href="mailto:rs-ecology@lists.uni-wuerzburg.de">rs-ecology@lists.uni-wuerzburg.de</a><br>
Subject: [RS-ecology] Problem with merging raster objects<br>
Message-ID:<br>
        <CAO1AbmQGUhj3EhX7m1ctDvMDqNs+tSU7jv+vPY_=<a href="mailto:NqPZ9HYw2Q@mail.gmail.com">NqPZ9HYw2Q@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Dear all,<br>
<br>
I'm having trouble merging Landsat scenes using the "merge" function in the<br>
raster package. No warnings are raised, but the merged scene looks as if<br>
overlap=FALSE - basically as though someone had taken a bunch of polaroids<br>
and placed them so they overlapped (if that does not make sense, please see<br>
attachment).<br>
I'd like to get rid of the white "frames" around the individual scenes<br>
before further processing. Does anyone happen to know what the problem with<br>
my code might be, or has anyone had similar problems?<br>
<br>
Thank you in advance for any hints you might be able to give!<br>
<br>
My code looks as follows:<br>
<br>
# I load adjacent scenes as multi-layer objects:<br>
<br>
scene1 <- stack(...) # multi-layer raster object; contains all 7 bands of<br>
the first scene<br>
scene2 <- stack(...)<br>
....<br>
scene10<- stack(...)<br>
<br>
# Then I try merging these raster objects using a for-loop:<br>
<br>
all_scenes <-as.list(print(c(scene1, scene2, ..., scene10)))<br>
<br>
for(i in 1:length(all_scenes))<br>
{<br>
  if (i == 1) {<br>
    merged_scenes <- all_scenes[[i]][[1:7]]<br>
  }<br>
else if (i > 1) {<br>
    merged_scenes <- merge(merged_scenes, all_scenes[[i]][[1:7]], tolerance<br>
= 0.05, overlap=TRUE)<br>
  }<br>
}<br>
<br>
writeRaster(merged_scenes, "filename", format = "GTiff", overwrite = TRUE)<br>
<br>
<br>
Best wishes,<br>
Henrike<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20160323/a8347751/attachment.html" rel="noreferrer" target="_blank">http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20160323/a8347751/attachment.html</a>><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: Failed scene merge.PNG<br>
Type: image/png<br>
Size: 56926 bytes<br>
Desc: not available<br>
URL: <<a href="http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20160323/a8347751/attachment.png" rel="noreferrer" target="_blank">http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20160323/a8347751/attachment.png</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
RS-ecology mailing list<br>
<a href="mailto:RS-ecology@lists.uni-wuerzburg.de">RS-ecology@lists.uni-wuerzburg.de</a><br>
<a href="https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology" rel="noreferrer" target="_blank">https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology</a><br>
<br>
<br>
End of RS-ecology Digest, Vol 7, Issue 1<br>
****************************************<br>
</blockquote></div><br></div>