Skip to content
Library and command-line tool to merge GeoTiff files using GDAL (C++ Version)
C++ CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

mergetiff GeoTiff Raster Merging Tool

This is a native C++ port of my Python library mergetiff. This implementation contains a header-only C++11 library and associated command-line tool called mergetiff that provides functionality to merge raster bands from multiple GeoTiff files into a single dataset. Metadata (including geospatial reference and projection data) will be copied from the first input dataset (when using the command-line tool) or from the dataset passed as the second argument to the DatasetManagement::createMergedDataset() function.

Command-line usage is identical to that of the Python version, see the relevant section of the Python version's README for details.



  • A modern, C++11-compliant compiler (Clang, GCC, Visual Studio 2015 or newer)
  • CMake 3.8 or newer
  • GDAL 2.0 or newer

Building from source

To build, use the standard CMake invocation:

mkdir build && cd build
cmake ..
cmake --build .

Under Windows, it may be necessary to specify the location of the GDAL library and headers. This can be done through the GDAL_DIR variable:

mkdir build && cd build
cmake -A x64 -DGDAL_DIR="path/to/gdal" ..
cmake --build . --config Release
You can’t perform that action at this time.