-
-
Save jsanz/65d81e0e2fd27faf79016d1cc89b70e8 to your computer and use it in GitHub Desktop.
Delete zoom levels from an MBTiles file (set max zoom)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- change 18 to whatever the max zoom level you want in your MBTiles | |
DELETE FROM images WHERE | |
tile_id IN (SELECT tile_id FROM map WHERE zoom_level > 18) AND | |
tile_id NOT IN (SELECT tile_id FROM map WHERE zoom_level <= 18); | |
DELETE FROM map WHERE zoom_level > 18; | |
UPDATE metadata SET value = '18' WHERE name = 'maxzoom'; | |
-- now run the VACUUM command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment