Based on the articles "Commandline Iterator - Extract Landsat TarGz Files in Batch" and "Stack Landsat8 MSI" our partner in the UK, Sterling Geo, has come up with a very interesting and useful Spatial Model capable of unpacking the .tar.gz archive files commonly used when downloading Landsat archived data, whether or not it is for Landsat 5, 7 or 8, and creating layer-stacked images. Here are the details:
This model is capable of unzipping and stacking all Landsat 5, 7 or 8 format files in a folder (new or old USGS format).
The only inputs required are the input and output directory and whether or not to output the cloud (BQA bands and cirrus) or Panchromatic data. It will then loop through all tar.gz files in the input directory and create stacked and automatically named image files in the output directory.
Firstly the model identifies which Landsat format the file is in, running only if that type exists.
Landsat_ImportZip_all_files_in_directory.gmdx |
Then the unzipping operation runs to extract the individual tiff files from the tar.gz.This community post was used to add the unzipping functionality. "Commandline Iterator - Extract Landsat TarGz Files in Batch"
Note that if you did not install ERDAS IMAGINE into the default path, you may need to dig into the Model and change the location of the un zipping program, as described in the linked article.
Next the extracted folder is used in a stacking sub model, stacking the bands into a msitir image (and the optional Pan and BQA images). The output multispectral images are named using the metadata file into; Landsat(5/7/8)_WRSpathWRSrow_Date Acquired(_pan/_cloud).img.
Landsat type |
Bands used |
Optional outputs |
Landsat 5 |
Bands stacked: 1 to 7 |
BQA (Collection 1 only) |
Landsat 7 |
Bands stacked: 1-7 including thermal |
BQA (Collection 1 only) and panchromatic option |
Landsat 8 |
Bands stacked: 1-7, 10, 11 |
BQA and panchromatic option |