I have a list of many many rasters. I want to have a simple and easy to understand script that takes this and merges it into one big mosaic. I found a similar question but the accepted answer adivices against using R for this purpose. I could also use R but are very inclined towards Python. I really need a script as I am going to simply share it with some people that want it in this form. I am inclined to using gdal_merge.py but I wanted some thoughts on the problem first as I am potentially going to handle massive amounts of images. Why merge so many images? I also found it impractical but was something I was asked to do.
Have you looked at using FWTools? There is a python script called gdal_merge that is available within FWTools. You can use a list as input. The command with usage would be:
gdal_merge -o c:\temp\output_image.tif -q -v --optfile c:\temp\rasterlist.txt
Another approach that doesn't generate a new image - specially in a situation where you have a plethora of large raster datasets - but uses the existing ones could be using the gdalbuildvrt command line: it gives you more control for the output through its options and you don't need to provide the txt file with the raster list if all of your images are in a single directory.
If your application doesn't support GDAL virtual formats (but most of OSGeo projects does, like QGIS and MapServer), you can still convert the generated VRT file (it is just an xml) to an effective image format using gdal_translate.