Skip to content

Instantly share code, notes, and snippets.

@geobabbler
Last active June 24, 2016 13:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geobabbler/9816088 to your computer and use it in GitHub Desktop.
Save geobabbler/9816088 to your computer and use it in GitHub Desktop.
Windows batch file to merge MBTiles database. Based on 'patch' (https://github.com/mapbox/mbutil/blob/master/patch)
REM based on 'patch' here: https://github.com/mapbox/mbutil/blob/master/patch
@ECHO OFF
REM goto CATCH
REM %1 = source database
REM %2 = destination database
echo PRAGMA journal_mode=PERSIST;PRAGMA page_size=80000;PRAGMA synchronous=OFF;ATTACH DATABASE '%1' AS source;REPLACE INTO map SELECT * FROM source.map;REPLACE INTO images SELECT * FROM source.images;REPLACE INTO grid_data SELECT * FROM source.grid_data; | "C:\spatialite3\bin\sqlite3.exe" %2%
GOTO FINALLY
:CATCH
echo there was an error
:FINALLY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment