Documentation ¶
Index ¶
- type DB
- func (tileset *DB) Close() error
- func (tileset *DB) ContentType() string
- func (tileset *DB) HasUTFGrid() bool
- func (tileset *DB) ReadGrid(z uint8, x uint64, y uint64, data *[]byte) error
- func (tileset *DB) ReadMetadata() (map[string]interface{}, error)
- func (tileset *DB) ReadTile(z uint8, x uint64, y uint64, data *[]byte) error
- func (tileset *DB) TileFormat() TileFormat
- func (tileset *DB) TileFormatString() string
- func (tileset *DB) TimeStamp() time.Time
- func (tileset *DB) UTFGridCompression() TileFormat
- type TileFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents an mbtiles file connection.
func NewDB ¶
NewDB creates a new DB instance. Connection is closed by runtime on application termination or by calling its Close() method.
func (*DB) ContentType ¶
ContentType returns the content-type string of the TileFormat of the DB.
func (*DB) HasUTFGrid ¶
HasUTFGrid returns whether the DB has a UTF grid.
func (*DB) ReadGrid ¶
ReadGrid reads a UTFGrid with identifiers z, x, y into provided *[]byte. data will be nil if the grid does not exist in the database, and an error will be raised. This merges in grid key data. The data is returned in the original compression encoding (zlib or gzip)
func (*DB) ReadMetadata ¶
ReadMetadata reads the metadata table into a map, casting their values into the appropriate type
func (*DB) ReadTile ¶
ReadTile reads a tile with tile identifiers z, x, y into provided *[]byte. data will be nil if the tile does not exist in the database
func (*DB) TileFormat ¶
func (tileset *DB) TileFormat() TileFormat
TileFormat returns the TileFormat of the DB.
func (*DB) TileFormatString ¶
TileFormatString returns the string representation of the TileFormat of the DB.
func (*DB) UTFGridCompression ¶
func (tileset *DB) UTFGridCompression() TileFormat
UTFGridCompression returns the compression type of the UTFGrid in the DB: ZLIB or GZIP
type TileFormat ¶
type TileFormat uint8
TileFormat is an enum that defines the tile format of a tile in the mbtiles file. Supported image formats:
- PNG
- JPG
- WEBP
- PBF (vector tile protocol buffers)
Tiles may be compressed, in which case the type is one of:
- GZIP
- ZLIB
Compressed tiles may be PBF or UTFGrids
const ( UNKNOWN TileFormat = iota // UNKNOWN TileFormat cannot be determined from first few bytes of tile GZIP // encoding = gzip ZLIB // encoding = deflate PNG JPG PBF WEBP )
Constants representing TileFormat types
func (TileFormat) ContentType ¶
func (t TileFormat) ContentType() string
ContentType returns the MIME content type of the tile
func (TileFormat) String ¶
func (t TileFormat) String() string
String returns a string representing the TileFormat