0

I have downloaded two tiles (150/36 and 150/37) from Landsat7 and unzipped into working directory say "L7".

I am trying to create a mosaic for all bands by following the link CreateLandsatMosaic. After putting all the files into a directory called "L7" and going into the path of that directory in Cygwin running in windows 8 machine, unzipped these tiles by following way:

for zipped in *tar.gz; do tar -xzvf $zipped; done

The two zipped files were unzipped into the same folder where zipped files are placed. The tif files for 150/36 and 150/37 are displayed like the following in the L7 folder:

LE71500362007137SGS00_B1.TIF  
LE71500362007137SGS00_B2.TIF
.
.
LE71500372007137SGS00_B1.TIF 
LE71500372007137SGS00_B2.TIF 
.
.

We want to automate this process to first build a list of unique scene ids consisting of band and row which we will then use in a loop to combine the bands per scene:

ls L*TIF | sed 's/_.*//' > scenes.list

scenes.list displays like the following:

LE71500362007137SGS00
LE71500362007137SGS00
LE71500362007137SGS00
LE71500362007137SGS00
LE71500362007137SGS00
LE71500362007137SGS00
LE71500362007137SGS00
LE71500362007137SGS00
LE71500362007137SGS00
LE71500372007137SGS00
LE71500372007137SGS00
LE71500372007137SGS00
LE71500372007137SGS00
LE71500372007137SGS00
LE71500372007137SGS00
LE71500372007137SGS00
LE71500372007137SGS00
LE71500372007137SGS00

Then in order to automate the process to produce vrt by the following code is as under:

for s in `cat scenes.list`; do gdalbuildvrt -separate $s.vrt ${s}*30.tif ${s}*20.tif ${s}*10.tif; done

But it displays a lot of error messages one of which is:

Warning 1: Can't open LE71500372007137SGS00*20.tif. Skipping it ERROR 4: `LE71500372007137SGS00*10.tif' does not exist in the file system, and is not recognised as a supported dataset name.

Can anybody help why this error is displaying and where I am getting wrong from the above-mentioned tutorial for producing Landsat mosaic (on Windows 8 by using gdalbuildvrt command like the same way as I did in cygwin using the automated script)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.