While merging the files using gdal_merge.py the following code works:


However, when the input files are numerous, each file can not be inserted separately. In this case, the following code does not work:


I did not know how to input the input files. Any idea is welcomed.

| improve this question | | | | |

you can loop on your files and append them to your list

command = [sys.executable,gmerge,'-o','C:\\r.tif','-of','GTiff']

images = glob.glob("D:\\*.tif")
for image in images:

| improve this answer | | | | |
  • No need to loop. This will work as well subprocess.call(command+images) – user2856 Jul 10 '14 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.