Skip to content

Instantly share code, notes, and snippets.

@isedwards
isedwards / img_tiles.py
Created August 8, 2013 13:54
Add to lib/cartopy/io/img_tiles.py to enable loading image tiles from an MBTiles file. Unfortunately the demo (see comments below) does not currently work due to new bug: https://github.com/SciTools/cartopy/issues/312
class MBTiles(GoogleTiles):
''' Retrieve tile data from MBTiles sqlite database instead of a url '''
def __init__(self, tile_db):
self.tile_db = tile_db
GoogleTiles.__init__(self)
def get_image(self, tile):
import cStringIO
import sqlite3
@isedwards
isedwards / gist:6049594
Last active December 20, 2015 01:29
OSM Bright - imposm - Postgres/PostGIS - Mapnik - TileMill - MBTiles script (ubuntu)
mkdir tile_cache
cd tile_cache
# Download Open Street Map Data
mkdir osm_data
cd osm_data
wget http://download.geofabrik.de/europe/great-britain/england/devon-latest.osm.pbf
wget http://download.geofabrik.de/europe/great-britain/england-latest.osm.pbf
cd ..