Documentation ¶
Index ¶
- func FindMBtiles(path string) ([]string, error)
- type MBtiles
- func (db *MBtiles) Close()
- func (db *MBtiles) GetFilename() string
- func (db *MBtiles) GetTileFormat() TileFormat
- func (db *MBtiles) GetTileSize() uint32
- func (db *MBtiles) GetTimestamp() time.Time
- func (db *MBtiles) ReadMetadata() (map[string]interface{}, error)
- func (db *MBtiles) ReadTile(z int64, x int64, y int64, data *[]byte) error
- type TileFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindMBtiles ¶
FindMBtiles recursively finds all mbtiles files within a given path.
Types ¶
type MBtiles ¶
type MBtiles struct {
// contains filtered or unexported fields
}
MBtiles provides a basic handle for an mbtiles file.
func Open ¶
Open opens an MBtiles file for reading, and validates that it has the correct structure.
func (*MBtiles) GetFilename ¶
func (*MBtiles) GetTileFormat ¶
func (db *MBtiles) GetTileFormat() TileFormat
GetTileFormat returns the TileFormat of the mbtiles file.
func (*MBtiles) GetTileSize ¶ added in v0.2.0
GetTileSize returns the tile size in pixels of the mbtiles file, if detected. Returns 0 if tile size is not detected.
func (*MBtiles) GetTimestamp ¶
Timestamp returns the time stamp of the mbtiles file.
func (*MBtiles) ReadMetadata ¶
ReadMetadata reads the metadata table into a map, casting their values into the appropriate type
type TileFormat ¶
type TileFormat uint8
TileFormat defines the tile format of tiles an 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 (assumed to be GZIP'd PBF data)
- ZLIB
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 )
TileFormat enum values
func (TileFormat) MimeType ¶
func (t TileFormat) MimeType() string
MimeType returns the MIME content type for the TileFormat
func (TileFormat) String ¶
func (t TileFormat) String() string
String returns a string representing the TileFormat.