Documentation ¶
Index ¶
- Constants
- Variables
- func NewCursor(tile *tegola.Tile) *cursor
- func SimplifyGeometry(g tegola.Geometry, tolerance float64, simplify bool) tegola.Geometry
- type Command
- type Feature
- type Layer
- func (l *Layer) AddFeatures(features ...Feature)
- func (l *Layer) Extent() int
- func (l *Layer) Features() (f []Feature)
- func (l *Layer) RemoveFeature(idxs ...int)
- func (l *Layer) SetExtent(e int)
- func (l *Layer) VTileLayer(ctx context.Context, tile *tegola.Tile) (*vectorTile.Tile_Layer, error)
- func (*Layer) Version() int
- type Tile
Constants ¶
const ( Version = 2 DefaultExtent = 4096 MimeType = "application/vnd.mapbox-vector-tile" )
Variables ¶
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 ¶
Types ¶
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 // Unsimplifed weather the Geometry is simple already and thus does not need to be simplified. Unsimplifed *bool }
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 ¶
NewFeatures returns one or more features for the given Geometry TODO: Should we consider supporting validation of polygons and multiple polygons here?
func (*Feature) VTileFeature ¶
func (f *Feature) VTileFeature(ctx context.Context, keys []string, vals []interface{}, tile *tegola.Tile, simplify bool, clip bool) (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 // DontSimplify truns off simplification for this layer. DontSimplify bool // MaxSimplificationZoom is the zoom level at which point simplification is turned off. if value is zero Max is set to 14. If you do not want to simplify at any level set DontSimplify to true. MaxSimplificationZoom uint // DontClip truns off clipping for this layer. DontClip bool // contains filtered or unexported fields }
Layer describes a layer in the tile. Each layer can have multiple features which describe drawing.
func (*Layer) AddFeatures ¶
AddFeatures will add one or more Features to the Layer per the spec features SHOULD have unique ids but it's not required
func (*Layer) Features ¶
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 ¶
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) VTileLayer ¶
VTileLayer returns a vectorTile Tile_Layer object that represents this layer.
Directories ¶
Path | Synopsis |
---|---|
Package vectorTile is a generated protocol buffer package.
|
Package vectorTile is a generated protocol buffer package. |