gdal_merage.py

Frank Warmerdam warmerdam at p...
Wed Nov 29 15:43:52 EST 2000


Folks, 

I have implemented a relatively simple Python script for merging many GDAL
datasets into one. It can be found in gdal/pymod, and called gdal_merge.py.

Usage: gdal_merge.py [-o out_filename] [-f out_format] [-v]
[-ps pixelsize_x pixelsize_y]
[-ul_lr ulx uly lrx lry] input_files


For instance the following would create a TIFF file called test.tif, with the
extents 138-139Longitude, 34-35Latitude from all the "*.mem" files. The -v
flag indicates verbose output. The pixel size in this case is defaulted based
on the pixel size of the first input file. 

gdal_merge.py -v -ul_lr 138 35 139 34 -o test.tif *.mem

The output format, and pixel size can also be overriden with commandline 
switches. By default the extents of the whole file set are used. 

This utility does not:
o Have any knowledge of "background values". The last file copied in always
overwrites anything underneath the area of the output file it overlaps. 

o Have any knowledge of the projection, nor does it set the projection 
information on the output file. In particular, it won't reproject files
in different projections to a common output projection. It is assumed that
all input files are in the same effective coordinate systems. 

o Handle auxilary information like colortables and so forth. 

o It does not provide control of the pixel type of the output file. It is
set to be the same as the first input file. 

Note the output file can be pre-existing in which case projection, pixel type
and other information could have been set more carefully ahead of time by some
other mechanism. 

I would like to thank Atlantis Scientific (http://www.atlsci.com/) who funded
this work, as well as the recent addition of Japanese DEM format to GDAL.

Best regards,

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




More information about the Gdal-dev mailing list