AnsweredAssumed Answered

Mosaic tifs in a folder, then iterate process in next folder

Question asked by socerplr12 on Sep 21, 2020

I have 30+ folders, each folder contains 8-20 tiffs. How can I mosaic the tiff's in the 1st folder together (using the folders name as the mosaic outputs name), then change to the next folder and repeat the mosaic operation, each time creating a new raster mosaic of just the tiff's in a given folder.

 

Sure, I could run mosaic_to_raster over and over changing the input workspace (folder) and entering an output name, but there must me a way to automate the iteration from one folder to the next and run the mosaic process per folder?

 

Example:

cd to folder 1 (00114), mosaic 9 tiffs and output to 00114.tif, cd to next folder "00115" and mosaic 10 tiffs and output to 00115.tif, cd "00116".......

 

All the individual folders are under one main folder or workspace named "Blocks".

Outcomes