[gdal-dev] gdalwarp and mosaic

Even Rouault even.rouault at mines-paris.org
Thu Nov 22 03:41:07 PST 2012


Selon DmitriyS <sazonov at scanex.ru>:

> Hello, dear developpers. I have one question. I wish to create mosaic image
> by the next way. In my output folder threre are two images. the first image
> is a mosaic image, and it is created by the command:
> gdalwarp.exe -of GTiff -s_srs "+proj=utm +ellps=WGS84 +zone=31 +units=m"
> "E:\bug\mosiac\image_1.tif" -overwrite "E:\bug\mosiac\merge.tif"
>
> Then I have to append the second image (without overwriting) to the first
> one (merge.tif) using next command:
> gdalwarp.exe -"E:\bug\mosiac\image_2.tif" "E:\bug\mosiac\merge.tif".
> The output window tells that's ok, merge.tif is done,  and does not signal
> any mistakes. However as result image_2.tif is not appended, merge.tif has
> no changes after this command execution.
> Can you say what I should do to append an image to existing image(file)?

To merge several images into a single one, you must provide all the source
images at the same time on the gdalwarp command line, so it can compute the
overall extent and allocate the appropriate raster dimensions.

If you do later invocations of gdalwarp on an existing target datasource, its
original extent and dimensions will be unmodified. So this will be in fact a
combined merge and clip operation.


More information about the gdal-dev mailing list