[gdal-dev] Looking for gdal_merge workflow

Carl Godkin cgodkin at gmail.com
Wed Sep 16 08:57:00 PDT 2015


Hi,

I have two satellite images of an area near the coast and I would like to
merge them somehow to get the best of both.

The larger image has black areas out to sea because the WMS service doesn't
have tiles at the highest resolution offshore.  (I've used "gdal_translate
-a_nodata 0" to mark the 0 values bands as "nodata.")

The smaller image covers the same area and has data over the whole area.

How can I merge them to get an image over the whole area where the higher
resolution data from the larger image is used where available, and the data
from the smaller image fills in the nodata values?

I tried various command lines for gdal_merge.  For instance

gdal_merge.py -o merge.tif larger.tif smaller.tif

but the result is basically a larger version of "smaller.tif" because it
"wins" in the overlapping areas.  The low-resolution image is sampled at
the higher resolution.

This command line

gdal_merge.py -o merge.tif  -px X Y smaller.tif larger.tif

(where X and Y are the pixel sizes for the larger image)

seems to keep all of the "nodata" values from the larger image
unfortunately.

Can you suggest a workflow to get what I want?  Is there another tool for
this I should use instead?

Thanks very much,

carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150916/473228ef/attachment.html>


More information about the gdal-dev mailing list