[RS-ecology] Problem with merging raster objects

Salomon César NGUEMHE cefils1 at yahoo.fr
Wed Mar 23 16:24:23 CET 2016


Hello,try to create a mask and clip each image before merging (see the pic attached)Best wishes,
Fils Salomon 
------------------------------------------------------------------------------------------------------------------------------------
Salomon Cesar NGUEMHE FILS 
Institute of Geological and Mining Research (IRGM)
Research Officer
Image Processing Laboratory (LTI)
National Data Centre (NDC) Cameroon
4110 Nlongkak_Yaounde, Cameroon. 
GSM (Cameroon): +237 672 77 82 37; +237 690 18 40 84 

    Le Mercredi 23 mars 2016 16h06, Henrike StB <henrikestb at gmail.com> a écrit :
 

 Dear all,

I'm having trouble merging Landsat scenes using the "merge" function in the raster package. No warnings are raised, but the merged scene looks as if overlap=FALSE - basically as though someone had taken a bunch of polaroids and placed them so they overlapped (if that does not make sense, please see attachment). 
I'd like to get rid of the white "frames" around the individual scenes before further processing. Does anyone happen to know what the problem with my code might be, or has anyone had similar problems?

Thank you in advance for any hints you might be able to give!

My code looks as follows:

# I load adjacent scenes as multi-layer objects:

scene1 <- stack(...) # multi-layer raster object; contains all 7 bands of the first scene
scene2 <- stack(...)
....
scene10<- stack(...)
# Then I try merging these raster objects using a for-loop:

all_scenes <-as.list(print(c(scene1, scene2, ..., scene10)))

for(i in 1:length(all_scenes))
{
  if (i == 1) {
    merged_scenes <- all_scenes[[i]][[1:7]]
  } 
else if (i > 1) {
    merged_scenes <- merge(merged_scenes, all_scenes[[i]][[1:7]], tolerance = 0.05, overlap=TRUE)
  }
}

writeRaster(merged_scenes, "filename", format = "GTiff", overwrite = TRUE)


Best wishes,
Henrike

_______________________________________________
RS-ecology mailing list
RS-ecology at lists.uni-wuerzburg.de
https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20160323/ba817596/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Failed scene merge.PNG
Type: image/png
Size: 58837 bytes
Desc: not available
URL: <http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20160323/ba817596/attachment-0001.png>


More information about the RS-ecology mailing list