Friday, January 30, 2015

Using gdalwarp to mosaic adjacent geo-referenced images

I had to merge adjacent 1 km by 1 km GeoTiff ortho-rectified mosaic images into 2 km by 2 km tiles and I really did not want to run the ortho-rectification and mosaicking processes again just to resize the tiles. After some digging around I found that GDAL has a few tools to perform the merging. I chose to use the gdalwarp executable, as it allows me to define a list of images to merge and the destination image bounds.


The following example shows how to use gdalwarp to merge 2 adjacent GeoTiff images into one.
Two adjacent image tiles to merge
  1. Open up a Command Prompt. Type in the gdalwarp command to merge two files e.g. left.tif and right.tif and output to a new file mosaic.tif:

    C:> gdalwarp left.tif right.tif mosaic.tif
  2. Press Return.

    Processing messages appear and the files are merged.



    The resultant merged GeoTiff image

No comments: