Utilities

Merge MBTiles utility

This feature is available in MapTiler Desktop PRO and MapTiler Engine editions with an activated license only, not in MapTiler Desktop PRO Demo. Merging MBTiles in GUI is described in this tutorial article.

The utility allows to update a previously rendered dataset and replace a small existing area with a different newly rendered raster data. The typical use-case is fixing of a small geographic area in a large seamed dataset previously rendered by MapTiler Engine from many input files.

The utility also extend the bounding box of the tiles - it is usable for merging two just partly overlapping maps into one bigger map covering larger extent.

Usage:

  merge_mbtiles [OPTION] BASE.mbtiles DETAIL.mbtiles [DETAIL_2.mbtiles]...

Typical usage:

  1. render a large dataset with MapTiler Engine - from several input files and produce large MBTiles (with JPEG or PNG tiles internally): large.mbtiles
  2. if you want to update one of the previously rendered input files in the existing dataset render just this file into MBTiles - with the PNG32 format and zoom-levels on which you want it to appear in the large dataset. Save the new small MBTiles with just one file to patch.mbtiles

Example:

  merge_mbtiles large.mbtiles patch.mbtiles

Existing tiles available in both large.mbtiles and the patch.mbtiles are going to be merged. On same zoom levels, patch.mbtiles will replace the original large.mbtiles - so the large.mbtiles will be updated in-place.

Further options:

-P [n]

Set limit on the defined number of cores.

-no_sparse

Fills the empty space between separate maps (if there is some) with empty tiles in a background color. This option can take longer to render, if there are huge areas between maps, as these have to be created. In case the maps overlap each other, there is no extra action involved. Default behavior without this option does not fill the empty space between separate maps.

-reencode

This option is useful when the 2 merged maps have a different format (e.g. jpeg and png). By default, the result is a hybrid format (combination of both of them). If reencode option is used, the chosen file is encoded to the actual format (which can slow down the process).