[gdal-dev] gdal_merge

william paul williampaul28 at yahoo.com
Sat Nov 1 08:31:54 EDT 2008


Thank you Frank:

It solved my problem :)

Best regards,

William




________________________________
From: Frank Warmerdam <warmerdam at pobox.com>
To: william paul <williampaul28 at yahoo.com>
Cc: gdal-dev at lists.osgeo.org
Sent: Friday, October 31, 2008 3:12:07 PM
Subject: Re: [gdal-dev] gdal_merge

william paul wrote:
>  
> Hello to everybody:
>  
> I want to use gdal_merge.py to mosaic four images. The images have the 
> same size, but the content of the images overlaps only in some areas. 
> The value for each images is something like : 1, 2, 3, 4
> I want to mosaic all the files, but I want to be able to specify which 
> image will overlap what image, for example, the order of overlapping 
> should be: 1 covers 2, 2 covers 3, 3 covers 4 without no blending 
> (opaque), so the final image will have values 1, 2, 3, 4, each values 
> corresponding to its position in the overlapping images
>  
> I have tried with: gdal_merge.py -0 merge.tif -of GTiff image1.tif 
> image2.tif image3.tif image4.tif, but I get the merge images with 0 
> values on most of the image and a 4 value on the position of the last image
>  
> Please, may I receive and example for doing this?

William,

No the four images include regions that should be considered "nodata"?  That
is areas that should not be copied into the destination image?  Would the
pixel value in these areas happen to be zero?  If so, try adding the
switch "-n 0" to the command.

eg.
gdal_merge.py -0 merge.tif -of GTiff -n 0 \
        image1.tif image2.tif image3.tif image4.tif

By the way, to get the order of precidence you want you should also reverse
the order of the input images so that image1.tif is last (overlayed to top
of everything else).

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/20081101/f23d6e2d/attachment.html


More information about the gdal-dev mailing list