[gdal-dev] merge with gdalwrap

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Thu Jul 30 14:49:05 EDT 2009

gdalwarp -srcnodata -3.4028234663852886e+38 \
          EstRN.img EstSh.img icu.tif

I thought I must launch gdalwrap once for each file. Didn't know I could 
specify several input files

I think I need to specify the extent and the resolution.
- Is the resolution is the pixel size get by gdalinfo?

- The Pixel Size is not the same for all images. Per example I got 
this for another image
Pixel Size = (30.000000000000000,-30.000000000000000)

What will append if I specify -tr 30 -30 as resolution in this case

Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction des risques biologiques, environnementaux et occupationnels
Institut national de santé publique du Québec
945, avenue Wolfe
Québec, Qc G1V 5B3 
Tél.: (418) 650-5115 #5281
Fax.: (418) 654-3144
steve.toutant at inspq.qc.ca

Frank Warmerdam <warmerdam at pobox.com> 
30/07/2009 02:19 PM

Steve.Toutant at inspq.qc.ca
gdal-dev at lists.osgeo.org
Re: [gdal-dev] merge with gdalwrap

Steve.Toutant at inspq.qc.ca wrote:
> Hi,
> I tried gdal_merge.py but I got a memory Error because I use the -n 
> nodata value option. Several threads sugest that I must use gdalwrap 
> instead.
> This behavior of gdal_merge.py is very important to me in this 
> particular case
> "In areas of overlap, the last image will be copied over earlier ones".
> Does gdalwrap has the same behavior? (I ask because it is difficult to 
> test and validate with my data)?


Yes, gdalwarp will overlay valid new data over existing data with the
last gdalwarp overlaying previous data.

> Also, the doc says "Mosaicing into an existing output file is supported 
> if the output file already exists."
> But how? What is the option to append data? When launching a command for 

> another image it says that I must delete the output file.

If you pass an output file to gdalwarp and it already exists then it
will be mosaiced into.  If the output file does not already exist
then one is created.  This is different than gdal_translate which
always creates a new file.

> I would appreciate if someone could validate if this
> gdalwarp -srcnodata -3.4028234663852886e+38 -dstnodata 
> -3.4028234663852886e+38 -of "GTiff" EstRN.img icu.tif
> is the equivalent of this
> gdal_merge.py -n -3.4028234663852886e+38 -o icu.tif -of "GTiff" 
> EstRN.img EstSh.img

Well, it doesn't mention EstSH.img - so no it does not seem
to be the same thing.  If you did:

gdalwarp -srcnodata -3.4028234663852886e+38 \
          EstRN.img EstSh.img icu.tif

then it should be pretty similar.  There are subtle differences
of course.

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090730/04b292bc/attachment.html

More information about the gdal-dev mailing list