In my last post I was explaining the usage of QGis to do a layerstack of a Landsat-scene. Due to the fact that further research and trying out resulted in frustration I decided to stick with a software I know well: R.
So download the needed layers here and open up your flavoured version of R (in my case RStudio).
What do we need is a package called raster
Now define the working directory where your ETM-bands are stored which is “ETM” in my case:
Let’s do the last step and create the stack using one line and store this raster object using a second line:
A=stack(c("p134r027_7dt20020722.SR.b01.tif","p134r027_7dt20020722.SR.b02.tif","p134r027_7dt20020722.SR.b03.tif","p134r027_7dt20020722.SR.b04.tif","p134r027_7dt20020722.SR.b05.tif", "p134r027_7dt20020722.SR.b07.tif")) writeRaster(A, filename="merge.tif") plotRGB(A, 3, 2, 1, stretch="hist")
That’s it. Easy, wasn’t it?
This is so great! How do you get the ETM bands and the tif files, please?
I have made a video for that some time ago. The data used in the article was found using some ftp folders on the same website … Here is the Video: link
[…] the missing values problem of the non-covered areas of a landsat picture. First: get the data In the part one we have already described where to get the data. As the used dataset contains surface reflectance […]
Hello again! Did you use Windows or Linux/Ubuntu for this please?