An importer for MBTiles that processes GeoTIFF and other GDAL-compatible raster formats into tilesets.
- GDAL
- OSX: GDAL Complete from kyngchaos
- Other systems: GDAL binaries
- Python (included on OSX and Linux)
Clone the repository
git clone git://github.com/mapbox/raster2mb.git
Add raster2mb to your PATH and make it executable.
raster2mb raster_merc.tiff raster_merc.mbtiles
If GeoTIFFs are in projections other than EPSG:900913
(as many are), run gdalwarp first:
gdalwarp -t_srs EPSG:900913 raster.tiff raster_merc.tiff
Run raster2mb -h
for usage instructions.
This is a variation of the gdal2tiles script that supports MapBox mbtiles
SQLite tilesets as an output option. It has the same requirements as the original script - notably an installation of GDAL.
This tool is compatible with MBTiles 1.1. It does not implement the optional bounds
entry.
Because mbtiles is limited in the profiles it supports, it is only possible to use it to create tilesets from imagery that covers the entire world; imagery which is smaller will create a database successfully, but it will not be in the neccesary spherical mercator profile. If you wish to build a tileset, you must first make your image cover the entire world.