I want to create a mosaic of all tif files in a directory on windows 7.
How could I create a one-line command in the windows command line to loop through all tifs and merge them all together using gdal_merge.py?
I tried this;
for %i in (*.tif) do gdal_merge.py -of GTiff %i mosaic.tif
but it gives me an error about mosaic not being a supported dataset name??
Best Answer
Your command line will try to merge mosaic.tif (as part of *.tif) with itself. Creating the mosaic in another folder would prevent that.
The correct syntax for batch processing is:
This should also work for gdal_merge.py, but I prefer to work with the vrt solution.