-
-
Save moneytoo/eb8120bf572c37adc894a478463376dd to your computer and use it in GitHub Desktop.
Delete zoom levels from an MBTiles file (set max zoom)
This file contains hidden or 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 9 to whatever the max zoom level you want in your MBTiles | |
DELETE FROM tiles_data WHERE | |
tile_data_id IN (SELECT tile_data_id FROM tiles_shallow WHERE zoom_level > 9) AND | |
tile_data_id NOT IN (SELECT tile_data_id FROM tiles_shallow WHERE zoom_level <= 9); | |
DELETE FROM tiles_shallow WHERE zoom_level > 9; | |
UPDATE metadata SET value = '9' WHERE name = 'maxzoom'; | |
VACUUM; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment