mvt

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilFeature = fmt.Errorf("Feature is nil")
	// ErrUnknownGeometryType is the error retuned when the geometry is unknown.
	ErrUnknownGeometryType = fmt.Errorf("Unknown geometry type")
	ErrNilGeometryType     = fmt.Errorf("Nil geometry passed")
)

errors

Functions

This section is empty.

Types

type Command

type Command uint32

func NewCommand

func NewCommand(cmd uint32, count int) Command

func (Command) Count

func (c Command) Count() int

func (Command) ID

func (c Command) ID() uint32

func (Command) String

func (c Command) String() string

type Feature

type Feature struct {
	ID   *uint64
	Tags map[string]interface{}
	// Does not support the collection geometry, for this you have to create a feature for each
	// geometry in the collection.
	Geometry tegola.Geometry
}

Feature describes a feature of a Layer. A layer will contain multiple features each of which has a geometry describing the interesting thing, and the metadata associated with it.

func NewFeatures

func NewFeatures(geo tegola.Geometry, tags map[string]interface{}) (f []Feature)

NewFeatures returns one or more features for the given Geometry TODO: Should we consider supporting validation of polygons and multiple polygons here?

func (Feature) String

func (f Feature) String() string

func (*Feature) VTileFeature

func (f *Feature) VTileFeature(keys []string, vals []interface{}, extent tegola.BoundingBox, layerExtent int) (tf *vectorTile.Tile_Feature, err error)

VTileFeature will return a vectorTile.Feature that would represent the Feature

type Layer

type Layer struct {
	// This is the name of the feature, is has to be unique within a tile.
	Name string
	// contains filtered or unexported fields
}

Layer describes a layer in the tile. Each layer can have multiple features which describe drawing.

func (*Layer) AddFeatures

func (l *Layer) AddFeatures(features ...Feature) (skipped bool)

AddFeatures will add one or more Features to the Layer, if a features ID is a the same as Any already in the Layer, it will ignore those features. If the id fields is nil, the feature will always be added.

func (*Layer) Extent

func (l *Layer) Extent() int

Extent defaults to 4096

func (*Layer) Features

func (l *Layer) Features() (f []Feature)

Features returns a copy of the features in the layer, use the index of the this array to remove any features from the layer

func (*Layer) RemoveFeature

func (l *Layer) RemoveFeature(idxs ...int)

RemoveFeature allows you to remove one or more features, with the provided indexes. To figure out the indexes, use the indexs from the Features array.

func (*Layer) SetExtent

func (l *Layer) SetExtent(e int)

SetExtent sets the extent value

func (*Layer) VTileLayer

func (l *Layer) VTileLayer(extent tegola.BoundingBox) (*vectorTile.Tile_Layer, error)

VTileLayer returns a vectorTile Tile_Layer object that represents this Layer.

func (*Layer) Version

func (*Layer) Version() int

Version is the version of tile spec this layer is from.

type Provider

type Provider interface {
	// MVTLayer returns a layer object based
	MVTLayer(layerName string, tile tegola.Tile, tags map[string]interface{}) (*Layer, error)
	// LayerNames returns a list of layer name the Provider knows about.
	LayerNames() []string
}

Provider is the mechinism by which the system talks to different data providers.

type Tile

type Tile struct {
	// contains filtered or unexported fields
}

Tile describes a tile.

func TileFromVTile

func TileFromVTile(t *vectorTile.Tile) (*Tile, error)

TileFromVTile will return a Tile object from the given vectorTile Tile object

func (*Tile) AddLayers

func (t *Tile) AddLayers(layers ...*Layer) error

AddLayers adds a Layer to the tile

func (*Tile) Layers

func (t *Tile) Layers() (l []Layer)

Layers returns a copy of the layers in this tile.

func (*Tile) VTile

func (t *Tile) VTile(extent tegola.BoundingBox) (vt *vectorTile.Tile, err error)

VTile returns a tile object according to the Google Protobuff def. This function does the hard work of converting everthing to the standard.

Directories

Path Synopsis
Package vectorTile is a generated protocol buffer package.
Package vectorTile is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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