4

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??

Robert Buckley
  • 10,175
  • 14
  • 76
  • 156
  • gdal_merge.py -optfile list.txt does not work using osgeo4w (i.e., under Windows). Throws a DLL Load failed exception – GT. Mar 06 '15 at 20:24
  • According to the userdocs for gdal_merge, a script exists to kludge gdal_merge wildcards into Windows gdal, but I haven't tried it. See http://trac.osgeo.org/gdal/wiki/UserDocs/GdalMerge – GT. Mar 06 '15 at 20:34