encode

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeometryPoint           = "Point"
	GeometryMultiPoint      = "MultiPoint"
	GeometryLineString      = "LineString"
	GeometryMultiLineString = "MultiLineString"
	GeometryPolygon         = "Polygon"
	GeometryMultiPolygon    = "MultiPolygon"
)

Variables

This section is empty.

Functions

func EncodeFeature

func EncodeFeature(feature *geojson.Feature, opts *EncodingConfig) (*proto.Data_Feature, error)

func EncodeFeatureCollection

func EncodeFeatureCollection(collection *geojson.FeatureCollection, opts *EncodingConfig) (*proto.Data_FeatureCollection, error)

func EncodeGeometry

func EncodeGeometry(g *geojson.Geometry, opt *EncodingConfig) *proto.Data_Geometry

func EncodeId

func EncodeId(id interface{}) (*proto.Data_Feature_Id, error)

func EncodeIntId

func EncodeIntId(id interface{}) (*proto.Data_Feature_IntId, error)

func EncodeValue

func EncodeValue(val interface{}) (*proto.Data_Value, error)

func NewKeyStore

func NewKeyStore() *keyStore

func NewKeyStoreWithKeys

func NewKeyStoreWithKeys(keys []string) *keyStore

Types

type EncodingConfig

type EncodingConfig struct {
	Dimension uint
	Precision uint
	Keys      KeyStore
}

type EncodingOption

type EncodingOption func(o *EncodingConfig)

func FromAnalysis

func FromAnalysis(obj interface{}) EncodingOption

func WithDimension

func WithDimension(dimension uint) EncodingOption

func WithKeyStore

func WithKeyStore(store KeyStore) EncodingOption

func WithPrecision

func WithPrecision(precision uint) EncodingOption

type KeyStore

type KeyStore interface {
	Keys() []string
	IndexOf(key string) int
	Add(key string) int
	Reset()
}

Jump to

Keyboard shortcuts

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