Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mb-util
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ if __name__ == '__main__':
action="store_true",
default=False)

parser.add_option('--gzip', dest='gzip',
help='''Do gzip compression for all tiles (makes sense for pbf)''',
action="store_true",
default=False)

parser.add_option('--silent', dest='silent',
help='''Dictate whether the operations should run silently''',
action="store_true",
Expand Down
4 changes: 4 additions & 0 deletions mbutil/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ def disk_to_mbtiles(directory_path, mbtiles_file, **kwargs):
y = int(file_name)

if (ext == image_format):

if kwargs.get('gzip', False):
file_content = zlib.compress(file_content)

if not silent:
logger.debug(' Read tile from Zoom (z): %i\tCol (x): %i\tRow (y): %i' % (z, x, y))
cur.execute("""insert into tiles (zoom_level,
Expand Down