Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

joining together two mbtiles files

Tags:

sqlite

mbtiles

I haven't managed to find a way to join two *.mbtiles files together (first one contains zoom level from 0-16 and second one zoom level 17). I was working with different sqlite managers, but no mather how I have exported and imported database2 into database1, I had no success - binary field was always so badly corrupted that it couldn't get image.png back.

Does anyone know a simple procedurte of joining two mbtiles files together?

like image 487
vvidmar Avatar asked Jul 19 '13 12:07

vvidmar


1 Answers

If the two files have the same metadata, and if the tiles tables are actually tables and not views, you can simply append the data of one to the other table:

/* open database1 as main database, then: */
ATTACH 'database2' AS db2;
INSERT INTO tiles SELECT * FROM db2.tiles;
like image 174
CL. Avatar answered Jan 03 '23 11:01

CL.