3.5. Using Image Mosaics

The multi-temporal metrics are stored in a tiled format. To visualize data for a large region, tiles must be mosaicked together. GDAL tools provide a number of solutions to mosaic the data, either virtually (using VRT format) or as a single image file. The following describes the process of manual stitching the tiles into a mosaic:

  • Select tiles to stitch the data from.
  • Create a list of files to stitch and print it to a new text file. Use the full path to each file. The following example shows the list of tiles to stitch for one metric (example_file_list.txt).
  • Open OSGeo4w interface and navigate to the folder with the text file.
  • Execute the VRT generation command:

gdalbuildvrt -input_file_list list.txt band1.vrt

 

  • You may create a set of separate VRT files for each band, and then merge them together as multi-band image using the following command:

gdalbuildvrt -separate mult-band.vrt band1.vrt band2.vrt band3.vrt band4.vrt …

 

  • The VRT file can be directly loaded to QGIS. For use with other applications (i.e., ArcGIS), you will need to convert the VRT file into raster image:

gdal_translate -of "GTiff" -co "BIGTIFF=YES" -co "COMPRESS=LZW" band1.vrt band1.tif

 

To simplify the process of image mosaicking, the users advised using the mosaic_tiles.pl tool. For a first time users, you will need to download the tool from GLAD Tools Depository and save to C:\GLAD_1.0 folder. To execute the tool, follow these steps:

  • Make the list of tiles to process (single column, tile names only – see example tiles.txt)
  • Make a parameter file.
Parameters Comments

source=D:/Metrics_pheno_B

Source folder

list=tiles.txt

The name of the tile list

year=2018

Year

outname=average

Output name

bands=blue_av2575,green_av2575,red_av2575,nir_av2575,swir1_av2575,swir2_av2575

List of metrics to aggregate (comma separated, no spaces)

ogr=C:/Program Files/QGIS 2.18/OSGeo4w.bat

A link to OSGeo4w.bat file (check your local installation)

 

  • Open cmd, navigate to the folder with tile list, and run the program:

> perl C:/GLAD_1.0/mosaic_tiles.pl param_mosaic_average.txt

 

  • The output will represent a multi-band compressed GeoTIFF file with OVR to assist visualization in QGIS.