dbtile

package
v0.0.0-...-0f2305d Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseDb

func CloseDb()

CloseDb close connection to remote database Should be called in main with defer keyword

func DbGet1Tile

func DbGet1Tile(z int64, x int64, y int64) (int, []byte, error)

DbGet1Tile get tile data (only pbf image)

func GetTile

func GetTile(x int64, y int64, z int64, XYZtoEPSG bool) (tile []byte, httpCode int, err error)

GetTile Get 1 tile according to x,y,z and XYZtoEPSG conversion

func InitDb

func InitDb(sqliteFile string) error

InitDb connection to remote database

func InitMeta

func InitMeta()

InitMeta init meta attribute : This is necessary to init values used to generate etags and last-modified header

func WriteHTTPAnswer

func WriteHTTPAnswer(w http.ResponseWriter, r *http.Request, route string, XYZtoEPSG bool)

WriteHTTPAnswer http answer to a tile request

Types

type DbMap

type DbMap struct {
	ZoomLevel  int64  `db:"zoom_level" json:"zoom_level"`
	TileColumn int64  `db:"tile_column" json:"tile_column"`
	TileRow    int64  `db:"tile_row" json:"tile_row"`
	TileID     string `db:"tile_id" json:"tile_id"`
	TileData   []byte `db:"tile_data" json:"tile_data,omitempty"` //NOTE: the []byte will be base64 encoded by JSON Marshall (nice)
}

DbMap is map struct that match SQL select

func DbGet1TileDetail

func DbGet1TileDetail(z int64, x int64, y int64) (int, *DbMap, error)

DbGet1TileDetail get tile image + data by x/y coordinate and z zoom level

type DbMapMeta

type DbMapMeta struct {
	Center    string `db:"center" json:"center"`
	Bounds    string `db:"bounds" json:"bounds"`
	Maxzoom   string `db:"maxzoom" json:"maxzoom"`
	Minzoom   string `db:"minzoom" json:"minzoom"`
	Mtime     string `db:"mtime" json:"mtime"`
	MaskLevel string `db:"maskLevel" json:"masklevel"`
	Format    string `db:"format" json:"format"`
	Filesize  string `db:"filesize" json:"filesize"`
	Type      string `db:"type" json:"type"`
}

DbMapMeta Metadata info

func DbGetMeta

func DbGetMeta() (int, *DbMapMeta, error)

DbGetMeta get metadata Note: metadata are not mandatory and can not exist in an mtile sqlite file, so this function maxbe useless

type MapMeta

type MapMeta struct {
	Maxzoom      int64  `json:"maxzoom"`
	Minzoom      int64  `json:"minzoom"`
	EtagPrefix   string `json:"etagprefix"`
	LastModified string `json:"lastmodified"`
}

MapMeta base Metadat info

Jump to

Keyboard shortcuts

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