I am very new to all this coding/scripting thing and now don't know how to use https://github.com/mapbox/mbutil/blob/master/patch. It just says

$ patch [source] [dest]

but where do I put this? Python, I guess, but it says that the syntax is invalid when I put

patch C:/Temp/1.mbtiles C:/Temp/2.mbtiles

Or do I have to use another command interpreter? Execute it from a certain folder?


The script that you are referring to is a Bash shell script and not a Python script. Therefore you need to make sure to run it in a Bash shell. How to do this has been discussed on SO before (see here). You could install Cygwin or MSYS, and it would probably work. However, if you just need to run this simple script (and not too often), this would be rather overkill in my opinion.

Alternatively, you might simply want to run the commands from the script manually in SQLite using SQL (e.g. with sqlite3 command line tool or probably even a GUI interface such as DB Browser for SQLite might work). All the SQL commands are written at the bottom in the script, lines 31 to 36:

PRAGMA journal_mode=PERSIST;
PRAGMA page_size=80000;
PRAGMA synchronous=OFF;
REPLACE INTO map SELECT * FROM source.map;
REPLACE INTO images SELECT * FROM source.images;

You need to do this with your destination database open, and $1 is the path to your source database. Not very elegant, but should work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.