/mbtiles-go

Go MBtiles reader

Primary LanguageGoMIT LicenseMIT

MBTiles Reader for Go

A simple Go-based mbtiles reader.

Build Status Coverage Status GoDoc Go Report Card

Supports JPG, PNG, WebP, and vector tile tilesets created according to the mbtiles specification.

Example:

// Open an mbtiles file
db, err := mbtiles.Open("testdata/geography-class-jpg.mbtiles")
if err != nil { ... }
defer db.Close()

// read a tile into a byte slice
var data []byte
err = db.ReadTile(0, 0, 0, &data)
if err != nil { ... }

Credits:

This was adapted from the mbtiles package in mbtileserver to use the crawshaw.io/sqlite SQLite library.