mbtiles

package
v0.0.0-...-b16440c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2017 License: ISC Imports: 14 Imported by: 0

Documentation

Index

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
}

func NewDB

func NewDB(filename string) (*DB, error)

Creates a new DB instance. Connection is closed by runtime on application termination or by calling .Close() method.

func (*DB) Close

func (tileset *DB) Close() error

Close closes the DB database connection

func (DB) ContentType

func (d DB) ContentType() string

ContentType returns the content-type string of the TileFormat of the DB.

func (DB) HasUTFGrid

func (d DB) HasUTFGrid() bool

HasUTFGrid returns whether the DB has a UTF grid.

func (DB) HasUTFGridData

func (d DB) HasUTFGridData() bool

HasUTFGridData returns whether the DB has UTF grid data.

func (*DB) ReadGrid

func (tileset *DB) ReadGrid(z uint8, x uint64, y uint64, data *[]byte) error

Reads a grid at z, x, y into provided *[]byte. This merges in grid key data, if any exist The data is returned in the original compression encoding (zlib or gzip)

func (*DB) ReadMetadata

func (tileset *DB) ReadMetadata() (map[string]interface{}, error)

Read the metadata table into a map, casting their values into the appropriate type

func (*DB) ReadTile

func (tileset *DB) ReadTile(z uint8, x uint64, y uint64, data *[]byte) error

Reads a grid at z, x, y into provided *[]byte.

func (DB) TileFormat

func (d DB) TileFormat() TileFormat

TileFormatreturns the TileFormat of the DB.

func (DB) TileFormatString

func (d DB) TileFormatString() string

TileFormatString returns the string representation of the TileFormat of the DB.

func (DB) TimeStamp

func (d DB) TimeStamp() time.Time

TimeStamp returns the time stamp of the DB.

func (DB) UTFGridCompression

func (d DB) UTFGridCompression() TileFormat

UTFGridCompression returns the compression type of the UTFGrid in the DB: ZLIB or GZIP

type TileFormat

type TileFormat uint8
const (
	UNKNOWN TileFormat = iota
	GZIP               // encoding = gzip
	ZLIB               // encoding = deflate
	PNG
	JPG
	PBF
	WEBP
)

func (TileFormat) ContentType

func (t TileFormat) ContentType() string

func (TileFormat) String

func (t TileFormat) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL