I am using GDAL 1.91 on a Windows 7 machine. I have been mosaicing large numbers of rasters together and most of the time this process works exactly as expected. However a very few of my mosaics look incomplete. It is as though GDAL_merge simply ignored some of my input files (see image - notice the top lefthand corner):
To try and eliminate this problem I have:
- checked that the missing rasters are valid and exist in my file system (correct on both counts - they display individually without error)
- checked my input string and that definitely includes the missing rasters.
- made all the input rasters the same type (e.g. Float32)
- explicitly specified the no_data value to ignore in the inputs
- EDIT: all the inputs are also the same resolution and running with verbose output gives no clues of any errors either
The mosaic process involves joining a maximum of 395 rasters each of which is 980KB and the resultant files should be about 390MB. The process works very well most of the time, so this suggests that it is not a memory issue (I have 6GB of RAM and am using the 64 bit version of GDAL).
The error is not isolated to only one mosaic. I have seen this elsewhere before and with GDAL 1.8 (which is why I upgraded to 1.91). In this particular case, the result using GDAL 1.8 was almost the exact opposite (i.e. the top left hand corner of this area did have data and the bottom left was empty - thus proving my data are valid but mystifying me further as to what is going wrong).
Changing the order of my input files does sometimes make a difference but usually does not entirely solve the issue.
Is this a bug (this is my gut feeling at the moment)? Otherwise, does anybody have any suggestions for what might be going wrong and/or work arounds?
UPDATE: I have been studying my rasters in QGIS looking for differences and the ONLY difference I can see is that, although all the rasters were created in exactly the same way and are all the same resolution, same projection and all geotiffs, QGIS quotes the driver as VRT/Virtual Raster for the ones which gdal_merge is failing. QGIS correctly quotes the driver as GeoTiff for the rest!?! Gdalinfo on the other hand, quotes the driver as GTiff/GeoTiff for all the files.
So - there is SOMETHING different about the tiles but what and why is not obvious... more digging to follow...