Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeBoolValue(v bool) []byte
- func EncodeByteValue(v []byte) []byte
- func EncodeBytes(v []byte) []byte
- func EncodeFloat32Value(v float32) []byte
- func EncodeFloat64Value(v float64) []byte
- func EncodeInt64Value(v int64) []byte
- func EncodeKey(key string) []byte
- func EncodeString(v string) []byte
- func EncodeStringValue(v string) []byte
- func EncodeUint32(v uint32) []byte
- func EncodeUint64Value(v uint64) []byte
- func EncodeUvarint(v uint64) []byte
- func EncodeVarint(v int64) []byte
- func MercatorBoundsToGeoBounds(b [4]float64) [4]float64
- type ByteColumn
- type FeatureTable
- func (t *FeatureTable) Column(i int) *ByteColumn
- func (t *FeatureTable) EncodeToLayer(name string, tile *tiles.TileID, config *tiles.EncodingConfig) ([]byte, error)
- func (t *FeatureTable) Geometry() *geos.GeometryArray
- func (t *FeatureTable) GetLayerInfo(name string, description string, minZoom uint8, maxZoom uint8) (*LayerInfo, error)
- func (t *FeatureTable) NumCols() int
- func (t *FeatureTable) Size() int
- func (t *FeatureTable) Take(indexes []int) *FeatureTable
- type LayerInfo
Constants ¶
const ( // Feature fields FEATURE_ID_FIELD byte = 8 // (1 << 3) | 0 FEATURE_TAGS_FIELD byte = 18 // (2 << 3) | 2 FEATURE_GEOM_TYPE_FIELD byte = 24 // (3 << 3) | 0 FEATURE_GEOMETRY_FIELD byte = 34 // (4 << 3) | 2 // Layer fields LAYER_VERSION_FIELD byte = 120 // (15 << 3) | 0 LAYER_NAME_FIELD byte = 10 // (1 << 3) | 2 LAYER_FEATURES_FIELD byte = 18 // (2 << 3) | 2 LAYER_KEY_FIELD byte = 26 // (3 << 3) | 2 LAYER_VALUE_FIELD byte = 34 // (4 << 3) | 2 LAYER_EXTENT_FIELD byte = 40 // (5 << 3) | 0 // Value fields VALUE_STRING_FIELD byte = 10 // (1 << 3) | 2 VALUE_FLOAT32_FIELD byte = 21 // (2 << 3) | 5 VALUE_FLOAT64_FIELD byte = 24 // (3 << 3) | 1 VALUE_INT64_FIELD byte = 32 // (4 << 3) | 0 VALUE_UVARINT64_FIELD byte = 40 // (5 << 3) | 0 VALUE_VARINT64_FIELD byte = 48 // (6 << 3) | 0 VALUE_BOOL_FIELD byte = 56 // (6 << 3) | 0 // Tile fields TILE_LAYERS_FIELD byte = 26 // (3 << 3) | 2 )
Byte identifiers of fields in MVT protobuf These are encoded as: (field ID << 3) | field type see https://developers.google.com/protocol-buffers/docs/encoding
Variables ¶
var EARTH_RADIUS float64 = 6378137.0
var RAD2DEG float64 = 180 / math.Pi
Functions ¶
func EncodeBoolValue ¶
EncodeByteValue encodes a bool as a Value for the MVT protobuf
func EncodeByteValue ¶
EncodeByteValue encodes a byte slice as a Value for the MVT protobuf
func EncodeBytes ¶
EncodeBytes returns a byte buffer with the a Uvarint of the length of the byte slice followed by the bytes
func EncodeFloat32Value ¶
EncodeByteValue encodes a float32 as a Value for the MVT protobuf
func EncodeFloat64Value ¶
EncodeByteValue encodes a float36 as a Value for the MVT protobuf
func EncodeInt64Value ¶
EncodeByteValue encodes a int64 as a Value (of type Varint) for the MVT protobuf
func EncodeKey ¶
EncodeKey returns a buffer representing the key type, followed by the length of the string, followed by the bytes representing the string
func EncodeString ¶
EncodeString returns a byte buffer with the a Uvarint of the length of the string followed by the string value
func EncodeStringValue ¶
EncodeByteValue encodes a string as a Value for the MVT protobuf
func EncodeUint32 ¶
func EncodeUint64Value ¶
EncodeByteValue encodes a uint64 as a Value (of type Uvarint) for the MVT protobuf
func EncodeUvarint ¶
EncodeUvarint returns a byte buffer with the bytes representing the Uvarint value of v
func EncodeVarint ¶
EncodeUvarint returns a byte buffer with the bytes representing the Varint value of v
Types ¶
type ByteColumn ¶
type ByteColumn struct { Name string Type string // MVT type // contains filtered or unexported fields }
ByteColumn represents a ByteColumn of MVT encoded value data
func NewByteColumn ¶
func NewByteColumn(name string, colType string, values []colValue) *ByteColumn
func NewEmptyByteColumn ¶
func NewEmptyByteColumn(name string, colType string, size int) *ByteColumn
func (*ByteColumn) GetValue ¶
func (c *ByteColumn) GetValue(i int) []byte
func (*ByteColumn) SetValue ¶
func (c *ByteColumn) SetValue(i int, value []byte)
func (*ByteColumn) Size ¶
func (c *ByteColumn) Size() int
func (*ByteColumn) Take ¶
func (c *ByteColumn) Take(indexes []int) *ByteColumn
Take creates a new ByteColumn by taking values from the ByteColumn specified by integer indexes. Out of bounds indexes will cause a panic.
type FeatureTable ¶
type FeatureTable struct {
// contains filtered or unexported fields
}
FeatureTable is a data structure for holding feature information as a GeometryArray and array of encoded attribute data
func ReadFeather ¶
func ReadFeather(path string, idColName string) (*FeatureTable, error)
func (*FeatureTable) Column ¶
func (t *FeatureTable) Column(i int) *ByteColumn
func (*FeatureTable) EncodeToLayer ¶
func (t *FeatureTable) EncodeToLayer(name string, tile *tiles.TileID, config *tiles.EncodingConfig) ([]byte, error)
func (*FeatureTable) Geometry ¶
func (t *FeatureTable) Geometry() *geos.GeometryArray
func (*FeatureTable) GetLayerInfo ¶
func (*FeatureTable) NumCols ¶
func (t *FeatureTable) NumCols() int
func (*FeatureTable) Size ¶
func (t *FeatureTable) Size() int
func (*FeatureTable) Take ¶
func (t *FeatureTable) Take(indexes []int) *FeatureTable