Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaak committed Dec 20, 2017
1 parent 2fc4161 commit 7f741de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit 7f741de

Please sign in to comment.