This article describes the process of merging MBTiles in MapTiler Engine.
Merging of MBTiles is currently not supported by MapTiler Engine GUI. However, it is available as a command-line utility in MapTiler Engine.
In older versions, MapTiler can easily merge different maps in MBTiles format. It is also possible to replace a part of one MBTile with another MBTile. This feature is quite useful and saves a lot of rendering time in case you receive a new update of source data and you need to replace just a few zoom levels with this new part.
Merging MBTiles is one order of magnitude faster than processing source images in MapTiler Engine.
The merging process
Merging utility is available after every rendering of MBTiles or when you open the MBTiles file in MapTiler. When you close a preview, in the bottom part of the window you can find 4 buttons. The last one (Merge) will open the merging utility.
The tool has 2 options that affect the time of merging and quality of the image. “Start merging” button opens a dialog to choose the second file.
Important: chosen file always replaces tiles in the currently opened file! In case, there are different zoom levels in different layers, then the result will have zoom levels from both files.
The following example shows the whole world of Blue Marble image in spring (left image) which is merged with a half of Blue Marble winter image. In this case, spring image has to be opened in MapTiler and winter image added via the “Start merging” option.
There are 2 additional options available:
sparse - Fills the empty space between separate maps (if there is some) with empty tiles in the 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.
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 the reencode option is used, the chosen file is encoded to the actual format (which can slow down the process).