# README
MVT
This package contains functions and types for encoding a geometry in Mapbox Vector Tiles. This package depends on the protbuf package.
In short, a Tile
s has Layer
s, which have Feauture
s. The Feature
type
is what holds a single geom.Geometry
and associated metadata.
To encode a geometry into a tile, you need:
- a geometry
- a tile's
geom.Extent
in the same projection as the geometry - the size of the tile you want to output in pixels
note: the geometry must not go outside the tile extent. If this is unknown, use the clip package before encoding.
To encode:
- Call
PrepareGeomtry
, it returns ageom.Geometry
that is "reprojected" into pixel values relative to the tile - Add the returned geometry to a
Feature
, optionally with an ID and tags by callingNewFeatures
. - Add the feature to a
Layer
with a name for the layer by calling(*Layer).AddFeatures
- Add the layer to a
Tile
by calling(*Tile).AddLayers
- Get the
protobuf
tile by calling(*Tile).VTile
- Encode the
protobuf
into bytes withproto.Marshal
For an example, check the use of this package in tegola/atlas/map.go
# Packages
Package vectorTile is a generated protocol buffer package.
# Functions
Decode reads all the data from r and decodes the MVT tile into a Tile TODO(ear7h): handle tile tags.
DecodeByte decodes the MVT encoded bytes into a Tile.
No description provided by the author
NewCommand return a new command encoder.
NewCursor creates a new cursor for drawing and MVT tile.
NewFeatures returns one or more features for the given Geometry.
PrepareGeo converts the geometry's coordinates to tile pixel coordinates.
TileGeomCollection returns all geometries in a tile as a collection.
# Constants
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author