mbtiles

package
v0.0.0-...-5f4d5c9 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package mbtiles is a generated protocol buffer package.

It is generated from these files:

vector.proto

It has these top-level messages:

Tile

Index

Constants

View Source
const (
	MoveTo    CommandID = 1
	LineTo              = 2
	ClosePath           = 7
)

Variables

View Source
var Tile_GeomType_name = map[int32]string{
	0: "UNKNOWN",
	1: "POINT",
	2: "LINESTRING",
	3: "POLYGON",
}
View Source
var Tile_GeomType_value = map[string]int32{
	"UNKNOWN":    0,
	"POINT":      1,
	"LINESTRING": 2,
	"POLYGON":    3,
}

Functions

func CoordinatesToXY

func CoordinatesToXY(lat, lng float64, z uint) (x, y uint64)

CoordinatesToXY converts lat lng with z as zoom to x y tile

Types

type Command

type Command struct {
	ID     CommandID
	Values []uint32
}

func DecodeGeometry

func DecodeGeometry(g []uint32) []Command

type CommandID

type CommandID uint8

type DB

type DB struct {
	*sql.DB
	Debug bool
}

DB an MBTile reader

func NewDB

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

NewDB open an MBTile for reading

func (*DB) ReadTileData

func (db *DB) ReadTileData(z uint8, x uint64, y uint64) ([]byte, error)

ReadTileData returns []bytes from a tile

func (*DB) ServeHTTP

func (db *DB) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP serve the mbtiles at /tiles/11/618/722.pbf

type Tile

type Tile struct {
	Layers []*Tile_Layer `protobuf:"bytes,3,rep,name=layers" json:"layers,omitempty"`
}

func TileFromData

func TileFromData(b []byte) (*Tile, error)

TileFromData takes gzipped pbf data decode and returns a Tile

func (*Tile) Descriptor

func (*Tile) Descriptor() ([]byte, []int)

func (*Tile) GetLayers

func (m *Tile) GetLayers() []*Tile_Layer

func (*Tile) ProtoMessage

func (*Tile) ProtoMessage()

func (*Tile) Reset

func (m *Tile) Reset()

func (*Tile) String

func (m *Tile) String() string

type Tile_Feature

type Tile_Feature struct {
	Id       uint64        `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	Tags     []uint32      `protobuf:"varint,2,rep,packed,name=tags" json:"tags,omitempty"`
	Type     Tile_GeomType `protobuf:"varint,3,opt,name=type,enum=mbtiles.Tile_GeomType" json:"type,omitempty"`
	Geometry []uint32      `protobuf:"varint,4,rep,packed,name=geometry" json:"geometry,omitempty"`
}

func (*Tile_Feature) Descriptor

func (*Tile_Feature) Descriptor() ([]byte, []int)

func (*Tile_Feature) GetGeometry

func (m *Tile_Feature) GetGeometry() []uint32

func (*Tile_Feature) GetId

func (m *Tile_Feature) GetId() uint64

func (*Tile_Feature) GetTags

func (m *Tile_Feature) GetTags() []uint32

func (*Tile_Feature) GetType

func (m *Tile_Feature) GetType() Tile_GeomType

func (*Tile_Feature) ProtoMessage

func (*Tile_Feature) ProtoMessage()

func (*Tile_Feature) Reset

func (m *Tile_Feature) Reset()

func (*Tile_Feature) String

func (m *Tile_Feature) String() string

type Tile_GeomType

type Tile_GeomType int32
const (
	Tile_UNKNOWN    Tile_GeomType = 0
	Tile_POINT      Tile_GeomType = 1
	Tile_LINESTRING Tile_GeomType = 2
	Tile_POLYGON    Tile_GeomType = 3
)

func (Tile_GeomType) EnumDescriptor

func (Tile_GeomType) EnumDescriptor() ([]byte, []int)

func (Tile_GeomType) String

func (x Tile_GeomType) String() string

type Tile_Layer

type Tile_Layer struct {
	Version  uint32          `protobuf:"varint,15,opt,name=version" json:"version,omitempty"`
	Name     string          `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Features []*Tile_Feature `protobuf:"bytes,2,rep,name=features" json:"features,omitempty"`
	Keys     []string        `protobuf:"bytes,3,rep,name=keys" json:"keys,omitempty"`
	Values   []*Tile_Value   `protobuf:"bytes,4,rep,name=values" json:"values,omitempty"`
	Extent   uint32          `protobuf:"varint,5,opt,name=extent" json:"extent,omitempty"`
}

func (*Tile_Layer) Descriptor

func (*Tile_Layer) Descriptor() ([]byte, []int)

func (*Tile_Layer) GetExtent

func (m *Tile_Layer) GetExtent() uint32

func (*Tile_Layer) GetFeatures

func (m *Tile_Layer) GetFeatures() []*Tile_Feature

func (*Tile_Layer) GetKeys

func (m *Tile_Layer) GetKeys() []string

func (*Tile_Layer) GetName

func (m *Tile_Layer) GetName() string

func (*Tile_Layer) GetValues

func (m *Tile_Layer) GetValues() []*Tile_Value

func (*Tile_Layer) GetVersion

func (m *Tile_Layer) GetVersion() uint32

func (*Tile_Layer) ProtoMessage

func (*Tile_Layer) ProtoMessage()

func (*Tile_Layer) Reset

func (m *Tile_Layer) Reset()

func (*Tile_Layer) String

func (m *Tile_Layer) String() string

type Tile_Value

type Tile_Value struct {
	StringValue string  `protobuf:"bytes,1,opt,name=string_value,json=stringValue" json:"string_value,omitempty"`
	FloatValue  float32 `protobuf:"fixed32,2,opt,name=float_value,json=floatValue" json:"float_value,omitempty"`
	DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"`
	IntValue    int64   `protobuf:"varint,4,opt,name=int_value,json=intValue" json:"int_value,omitempty"`
	UintValue   uint64  `protobuf:"varint,5,opt,name=uint_value,json=uintValue" json:"uint_value,omitempty"`
	SintValue   int64   `protobuf:"zigzag64,6,opt,name=sint_value,json=sintValue" json:"sint_value,omitempty"`
	BoolValue   bool    `protobuf:"varint,7,opt,name=bool_value,json=boolValue" json:"bool_value,omitempty"`
}

func (*Tile_Value) Descriptor

func (*Tile_Value) Descriptor() ([]byte, []int)

func (*Tile_Value) GetBoolValue

func (m *Tile_Value) GetBoolValue() bool

func (*Tile_Value) GetDoubleValue

func (m *Tile_Value) GetDoubleValue() float64

func (*Tile_Value) GetFloatValue

func (m *Tile_Value) GetFloatValue() float32

func (*Tile_Value) GetIntValue

func (m *Tile_Value) GetIntValue() int64

func (*Tile_Value) GetSintValue

func (m *Tile_Value) GetSintValue() int64

func (*Tile_Value) GetStringValue

func (m *Tile_Value) GetStringValue() string

func (*Tile_Value) GetUintValue

func (m *Tile_Value) GetUintValue() uint64

func (*Tile_Value) ProtoMessage

func (*Tile_Value) ProtoMessage()

func (*Tile_Value) Reset

func (m *Tile_Value) Reset()

func (*Tile_Value) String

func (m *Tile_Value) String() string

Jump to

Keyboard shortcuts

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