Skip to content

Commit

Permalink
Merge pull request #31 from Schwanksta/patch-1
Browse files Browse the repository at this point in the history
Patch needed to get the correct grid_data and grid values together in the correct JSON file
  • Loading branch information
tmcw committed Jul 10, 2012
2 parents 94e5ed2 + 5774622 commit a5594c6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mbutil/util.py
Expand Up @@ -232,6 +232,11 @@ def mbtiles_to_disk(mbtiles_file, directory_path, **kwargs):
zoom_level = g[0] # z
tile_column = g[1] # x
y = g[2] # y
grid_data_cursor = con.execute('''select key_name, key_json FROM
grid_data WHERE
zoom_level = %(zoom_level)d and
tile_column = %(tile_column)d and
tile_row = %(y)d;''' % locals() )
if kwargs.get('scheme') == 'xyz':
y = flip_y(zoom_level,y)
grid_dir = os.path.join(base_path, str(zoom_level), str(tile_column))
Expand All @@ -241,11 +246,6 @@ def mbtiles_to_disk(mbtiles_file, directory_path, **kwargs):
f = open(grid, 'w')
grid_json = json.loads(zlib.decompress(g[3]))
# join up with the grid 'data' which is in pieces when stored in mbtiles file
grid_data_cursor = con.execute('''select key_name, key_json FROM
grid_data WHERE
zoom_level = %(zoom_level)d and
tile_column = %(tile_column)d and
tile_row = %(y)d;''' % locals())
grid_data = grid_data_cursor.fetchone()
data = {}
while grid_data:
Expand Down

0 comments on commit a5594c6

Please sign in to comment.