Skip to content

Instantly share code, notes, and snippets.

@ajashton
Created March 11, 2011 17:52
Show Gist options
  • Save ajashton/866259 to your computer and use it in GitHub Desktop.
Save ajashton/866259 to your computer and use it in GitHub Desktop.
diff --git a/mbutil.py b/mbutil.py
index 5a79887..a732c3f 100755
--- a/mbutil.py
+++ b/mbutil.py
@@ -152,13 +152,13 @@ def disk_to_mbtiles(directory_path, mbtiles_file):
msg = ""
for r1, zs, ignore in os.walk(directory_path):
for z in zs:
- for r2, ys, ignore in os.walk(os.path.join(r1, z)):
- for y in ys:
- for r2, ignore, xs in os.walk(os.path.join(r1, z, y)):
- for x in xs:
- f = open(os.path.join(r1, z, y, x), 'r')
+ for r2, xs, ignore in os.walk(os.path.join(r1, z)):
+ for x in xs:
+ for r2, ignore, ys in os.walk(os.path.join(r1, z, x)):
+ for y in ys:
+ f = open(os.path.join(r1, z, x, y), 'r')
con.execute("""insert into tiles (zoom_level,
- tile_row, tile_column, tile_data) values
+ tile_column, tile_row, tile_data) values
(?, ?, ?, ?);""",
(z, x, y, sqlite3.Binary(f.read())))
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment