[Gdal-dev] how to calculate needed mem?

Frank Warmerdam warmerdam at pobox.com
Tue Oct 25 18:11:19 EDT 2005


On 10/25/05, Matt Wilkie <matt.wilkie at gov.yk.ca> wrote:
> Hi, is there a rule of them I can use to calculate how much memory will
> be needed for gdal_merge operations?
>
> My current method of adding more tiles onto the input queue until I get
> "MemoryError: can't allocate memory for array" is a little wasteful and
> time consuming...

Matt,

The amount of memory used by gdal_merge.py  is supposed to be
proportional to the size of the largest input tile, not the output mosaic.

> Or maybe it would be better to ask if there some way of doing things in
> pieces, not loading the complete extents into ram at one time?

It would be better to use gdal_merge.py to create the output file using
the new -createonly flag, and then use gdalwarp to actually mosaic
the images in.  Gdalwarp does sensible things about memory.

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