Tile Stitch is a tool aimed at replacing tiles inside a given mbtiles file with tiles from another set of tiles, using a polygon to mask the stitching area and merge if needed contents from both sets of boundary tiles.
This project in based on NodeJs
This project use Tippecanoe and GDAL
git clone https://github.com/gencat/ICGC-tile-stitch.git
cd ICGC-tile-stitch
npm install
Edit config.js
f.mbtiles_ori = './icgc.mbtiles'; // your local tiles
_f.mbtiles_dest = './europe_spain.mbtiles'; // Country Mbtiles from OpenMaptiles
_f.pol_cat = './CAT_plus_box.geojson'; //clipping polygon
_f.mbtiles_planet = './planet.mbtiles'; //full planet from OpenMaptiles
_f.zoom_levels = [7,8,9,10,11,12,13,14]; //replace zoom levels
./stitch.sh
node mergeMbtiles.js
node mergePlanet.js
=======
if your local mbtiles has levels higher than 14 and diferents data models local.mbtiles -> planet.mbtiles
node addExtraLevelsToPlanet.js
Option B planet.mbtiles -> local.mbtiles tile-join -Z 15 -o ctxmaps15-16.mbtiles ctxmaps_0_5_0.mbtiles
#extract higher levels
tile-join -Z 15 -o ctxmaps15-16.mbtiles local.mbtiles
#insert planet14 into ctxmaps15-16.mbtiles
sqlite3
ATTACH "planet14.mbtiles" AS db1;
ATTACH "ctxmaps15-16.mbtiles" AS db2;
INSERT INTO db2.tiles SELECT * FROM db1.tiles;
This project is licensed under the MIT License - see the LICENSE file for details