Skip to content

Instantly share code, notes, and snippets.

View schoenobates's full-sized avatar

Alex Davies-Moore schoenobates

View GitHub Profile
@schoenobates
schoenobates / mbtile-extractor.py
Created August 3, 2012 09:43
Extracts a pyramid of image tiles from a MBTile file
#!/usr/bin/env python
import sqlite3 as sqlite
import os
import sys
import time
# Extracts an mbtiles database into a pyramid structure
if len(sys.argv) != 2:
@schoenobates
schoenobates / mbtile-server.py
Created August 3, 2012 09:39
Really quick and dirty way to serve tiles from a MBTiles file
#!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import re
import sqlite3 as sqlite
# Hacky serving of MBtile data
# Put filename to the MBTiles file below: this could be done with cmd line options
# but this is a hack so there ....