[gdal-dev] gdal_merge error with large 16 bit images

Frank Warmerdam warmerdam at pobox.com
Mon Mar 23 10:07:29 EDT 2009


On Mon, Mar 23, 2009 at 5:04 AM, Ned Horning <horning at amnh.org> wrote:
> Greetings,
>
> I am having trouble running gdal_merge on large unsigned 16 bit imagery. I
> am using the OSGeo4W installation of gdal_merge.py. When I run it on 8-bit
> unsigned GeoTiff imagery (Landsat TM) the program works as expected. When I
> run it on two small 16-bit unsigned int GeoTiff subsets (500 samples x 1000
> lines) from an IKONOS image that also works as expected. However, when I try
> to mosaic two large (~1.4GB/image) unsigned integer GeoTiff images (IKONOS)
> the program ends with a Windows error message: “python.exe has encounters a
> problem and needs to close.”Here is some additional information:
>
> When I run gdal_merge using the large IKONOS imagery on my Ubuntu box I get
> a segmentation fault error.
>
> I'm running this on a laptop with Windows XP and 1GB RAM. The command I am
> using is pasted below.
>
> I am able to mosaic the images using gdalwarp but it takes over 4 hours to
> complete and when I run these under Ubuntu a question mark ("?") is tacked
> to the end of the output file name.
>
> Unfortunately the images are too large for me to upload since I'm currently
> in Tanzania.

Ned,

gdal_merge.py attempts to load the whole source image into memory
before plopping it into the output mosaic.  So it is possible to make very
large mosaics out of modest sized input files, but it is not practical
to make mosaics out of very large input files.   This is a deficiency of
gdal_merge.py which was originally only intended to be a simple example
script.

You might try using gdalwarp to merge large images.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent


More information about the gdal-dev mailing list