[Gdal-dev] gdal_merge fails to merge more than 4 input files

Frank Warmerdam fwarmerdam at gmail.com
Wed Feb 2 16:44:25 EST 2005


On Wed, 2 Feb 2005 16:22:29 -0500, Sarah Clapham <sbclaph at ftgrp.com> wrote:
> Help!
> 
> I am trying to apply the now familiar procedure of
> reproject/merge/clip/compress to client image files in preparation for web
> serving and am having trouble with gdal_merge failing to merge more than 4
> input files.

Sarah,

I started out trying to think of all sorts of esoteric things that might be
going wrong, and then it hit me.  In FWTools gdal_merge is a bat
file and because I am a lame DOS bat-file person I use a very
cludgy method to pass arguments on to the real gdal_merge.py 
pythong script.   The bat file looks like this:

@python "%FWTOOLS_DIR%\pymod\gdal_merge.py" %1 %2 %3 %4 %5 %6 %7 %8 %9

So basically, it only passes the first 9 arguments on, and the rest are 
discarded.  After your switches I guess there are only four more
arguments passed on. 

I would encourage you to try invoking python directly with your
arguments.  So something like:

python %FWTOOLS_DIR%\pymod\gdal_merge.py  -v -n 0 
  -o ..\tif_org_merge\s-p05-13.tif s-p05-07.tif 
  s-p05-08.tif s-p05-09.tif s-p05-12.tif s-p05-13.tif s-p05-14.tif
  s-p05-18.tif

I would appreciate it if you could submit a bug on the FWTools
bugzilla about this issue.  All my python script cover scripts have
the same problem, but generally 9 args is plenty.  However, for
gdal_merge it is not at all surprising that it is not enough. 

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